Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions website/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,15 @@ html[data-theme="light"] .homePage .container {
}

.exampleSection .wrapperInner > div:nth-child(even) pre {
margin-left: 3em;
padding-top: 0;
}

pre {
background-color: var(--pre-background-color);
}

pre.outerPre {
box-shadow: var(--pre-box-shadow);
border: 1px solid var(--pre-border-color);
.outerPre {
margin-left: 3em;
}

.exampleSection p {
Expand All @@ -207,6 +205,8 @@ pre.outerPre {

.exampleSection pre {
margin-top: 15px;
border: 1px solid var(--pre-border-color);
font-size: 80%;
}

/* Text section */
Expand Down Expand Up @@ -454,6 +454,10 @@ pre.outerPre {
.exampleSection .wrapperInner > div:nth-child(even) pre {
margin-left: 0em;
}

.outerPre {
margin-left: 0;
}
}

@media only screen and (max-width: 768px) {
Expand Down
31 changes: 14 additions & 17 deletions website/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
* @oncall relay
*/

import Code from '../core/Code.js';
import Container from '../core/Container';
import GridBlock from '../core/GridBlock';
import Link from '@docusaurus/Link';
import {useThemeConfig} from '@docusaurus/theme-common';
import useBaseUrl, {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import Layout from '@theme/Layout';
import CodeBlock from '@theme/CodeBlock';
import * as React from 'react';

function LoadQueryLink() {
Expand Down Expand Up @@ -202,10 +202,9 @@ const Index = () => {
</div>

<div className="radiusLeft">
<pre className="outerPre">
<Code>
{`
import React from "react";
<div className="outerPre">
<CodeBlock>
{`import React from "react";
import { graphql, usePreloadedQuery, /* ... */ } from "react-relay";

const artistsQuery = graphql\`
Expand Down Expand Up @@ -240,10 +239,9 @@ function ArtistView() {
{data?.artist && <ArtistCard artist={data?.artist} />}
</>
);
}
`}
</Code>
</pre>
}`}
</CodeBlock>
</div>
</div>
</div>
</Container>
Expand Down Expand Up @@ -274,11 +272,11 @@ function ArtistView() {
fragments are fetched as part of that parent query.
</p>
</div>

<div>
<pre className="outerPre">
<Code>
{`
import React from "react";
<div className="outerPre">
<CodeBlock>
{`import React from "react";
import { graphql, useFragment} from "react-relay";

export default function ArtistCard(props) {
Expand All @@ -304,10 +302,9 @@ export default function ArtistCard(props) {
</Link>
</Card>
);
}
`}
</Code>
</pre>
}`}
</CodeBlock>
</div>
</div>
</div>
</Container>
Expand Down