This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
generated from atls-academy/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from atls-academy/feat/landing-seventh-step
- Loading branch information
Showing
162 changed files
with
4,054 additions
and
2,404 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,3 +47,5 @@ dist/ | |
.idea | ||
|
||
.next | ||
.env*.local | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "@globals/data", | ||
"version": "0.0.1", | ||
"main": "src/index.ts", | ||
"devDependencies": { | ||
"@apollo/client": "3.8.4", | ||
"@types/react": "18.2.6", | ||
"graphql": "16.8.1", | ||
"react": "18.2.0" | ||
}, | ||
"peerDependencies": { | ||
"@apollo/client": "*", | ||
"react": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { ApolloClient } from '@apollo/client' | ||
import { InMemoryCache } from '@apollo/client' | ||
|
||
export const getClient = () => | ||
new ApolloClient({ | ||
uri: process.env.NEXT_PUBLIC_ENV_LOCAL_GQL_URI ?? 'https://wp.api.atls.academy/graphql', | ||
cache: new InMemoryCache(), | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './get-client.helper' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './helpers' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import express from 'express' | ||
import next from 'next' | ||
import path from 'path' | ||
|
||
const bootstrap = async () => { | ||
const app = next({ | ||
dev: process.env.NODE_ENV !== 'production', | ||
dir: process.env.NODE_ENV !== 'production' ? path.join(__dirname, '../src') : __dirname, | ||
}) | ||
|
||
const handle = app.getRequestHandler() | ||
|
||
await app.prepare() | ||
|
||
const server = express() | ||
|
||
server.get('*', (req, res) => handle(req, res)) | ||
|
||
server.listen(process.env.PORT || 3000) | ||
} | ||
|
||
bootstrap() |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
import * as messages from '../../locales/ru.json' | ||
import { ApolloProvider } from '@apollo/client' | ||
|
||
import React from 'react' | ||
import { IntlProvider } from 'react-intl' | ||
import { ParallaxProvider } from 'react-scroll-parallax' | ||
|
||
import { ThemeProvider } from '@ui/theme' | ||
import { getClient } from '@globals/data' | ||
|
||
const App = ({ Component, pageProps, ...props }) => ( | ||
<IntlProvider messages={messages} locale='ru' defaultLocale='ru'> | ||
<ThemeProvider> | ||
<ParallaxProvider> | ||
<Component {...pageProps} {...props} /> | ||
</ParallaxProvider> | ||
</ThemeProvider> | ||
</IntlProvider> | ||
) | ||
const App = ({ Component, pageProps, ...props }) => { | ||
const client = getClient() | ||
|
||
return ( | ||
<ApolloProvider client={client}> | ||
<ThemeProvider> | ||
<ParallaxProvider> | ||
<Component {...pageProps} {...props} /> | ||
</ParallaxProvider> | ||
</ThemeProvider> | ||
</ApolloProvider> | ||
) | ||
} | ||
|
||
export default App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,61 @@ | ||
import React from 'react' | ||
|
||
import { Delimiter } from '@ui/delimiter' | ||
import { Box } from '@ui/layout' | ||
import { Row } from '@ui/layout' | ||
import { Layout } from '@ui/layout' | ||
import { Column } from '@ui/layout' | ||
import { Space } from '@ui/text' | ||
import { Text } from '@ui/text' | ||
|
||
import { DesktopTextBlock } from './text-block' | ||
import { MobileTextBlock } from './text-block' | ||
import { useAbout } from './data' | ||
|
||
export const About = () => ( | ||
<Column flexGrow='1'> | ||
<Layout flexBasis={[64, 160]} /> | ||
export const About = () => { | ||
const about = useAbout() | ||
|
||
<Row> | ||
<Layout flexBasis={[20, 230]} /> | ||
const problemMobile: string = about?.data?.section.content.split('\n')[1] | ||
const sloganMobile: string = about?.data?.section.content.split('\n')[2] | ||
const problemDesktop: string[] = problemMobile?.split('.').slice(0, 2) | ||
const sloganDesktop: string = sloganMobile?.slice(0, -1) | ||
|
||
<Column flexBasis={[335, 1460]} flexGrow='1' flexShrink='0'> | ||
<Box display={['none', 'inline']}> | ||
<DesktopTextBlock id='about.intro-desktop' /> | ||
return ( | ||
<Column flexGrow='1'> | ||
<Layout flexBasis={[64, 160]} /> | ||
|
||
<Space count='6' /> | ||
<Row> | ||
<Layout flexBasis={[20, 230]} /> | ||
|
||
<Delimiter /> | ||
|
||
<Space count='6' /> | ||
|
||
<DesktopTextBlock id='about.problem-desktop' /> | ||
|
||
<Space count='6' /> | ||
|
||
<Delimiter /> | ||
</Box> | ||
|
||
<Column display={['flex', 'none']}> | ||
<MobileTextBlock id='about.intro-digital-mobile' /> | ||
|
||
<MobileTextBlock id='about.intro-not-decrease-mobile' /> | ||
|
||
<MobileTextBlock id='about.intro-for-your-decisions-mobile' /> | ||
|
||
<Layout flexBasis={28} /> | ||
|
||
<MobileTextBlock id='about.central-idea-atlantis-teach-mobile' /> | ||
|
||
<MobileTextBlock id='about.central-idea-make-engineers-mobile' /> | ||
|
||
<MobileTextBlock id='about.central-idea-architects-mobile' /> | ||
<Column flexBasis={[335, 1460]} flexGrow='1' flexShrink='0'> | ||
<Box display={['none', 'inline']}> | ||
{problemDesktop?.map((el) => ( | ||
<DesktopTextBlock key={el[0]} text={el.trim()} /> | ||
))} | ||
</Box> | ||
|
||
<MobileTextBlock id='about.central-idea-not-programmers-mobile' /> | ||
</Column> | ||
<Column display={['flex', 'none']}> | ||
<Text color='text.white' fontSize='small' lineHeight='huge'> | ||
{problemMobile} | ||
</Text> | ||
|
||
<Layout flexBasis={[0, 40]} /> | ||
<Layout flexBasis={28} /> | ||
|
||
<Box display={['none', 'inline']}> | ||
<Box display='inline'> | ||
<DesktopTextBlock id='about.central-idea-desktop' /> | ||
<Text color='text.white' fontSize='small' lineHeight='huge'> | ||
{sloganMobile} | ||
</Text> | ||
</Column> | ||
|
||
<Space count='6' /> | ||
<Layout flexBasis={[0, 40]} /> | ||
|
||
<Delimiter /> | ||
<Box display={['none', 'inline']}> | ||
<Box display='inline'> | ||
<DesktopTextBlock text={sloganDesktop} /> | ||
</Box> | ||
</Box> | ||
</Box> | ||
</Column> | ||
</Column> | ||
|
||
<Layout flexBasis={[20, 230]} /> | ||
</Row> | ||
<Layout flexBasis={[20, 230]} /> | ||
</Row> | ||
|
||
<Layout flexBasis={[128, 240]} /> | ||
</Column> | ||
) | ||
<Layout flexBasis={[128, 240]} /> | ||
</Column> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './queries' |
9 changes: 9 additions & 0 deletions
9
landing/fragments/landing-about/src/data/queries/about.query.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { gql } from '@apollo/client' | ||
|
||
export const GET_ABOUT = gql` | ||
query About { | ||
section(id: "cG9zdDoyMjY=") { | ||
content | ||
} | ||
} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './useAbout' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { useQuery } from '@apollo/client' | ||
|
||
import { GET_ABOUT } from './about.query' | ||
|
||
export const useAbout = () => useQuery(GET_ABOUT) |
Oops, something went wrong.