Skip to content

Commit 9f62b51

Browse files
authored
Merge pull request hexlet-rus#707 from Lika1998Lika/component-home-page
hexlet-rus#686 update homepage
2 parents c005307 + 79adced commit 9f62b51

File tree

8 files changed

+2176
-1949
lines changed

8 files changed

+2176
-1949
lines changed

frontend/src/components/Footer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function Footer() {
2424
));
2525

2626
return (
27-
<Flex justify="space-between" wrap="wrap" mx="auto" style={{maxWidth: 1440}} px="md" py="xl">
27+
<Flex direction="row" justify="space-between" wrap="wrap" py="xl">
2828
<Text size="sm" c="dimmed">© {currentYear} RunIT</Text>
2929
<Group >{items}</Group>
3030
</Flex>

frontend/src/components/HomePage/index.tsx

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
1-
import { AppShell } from "@mantine/core";
1+
import { AppShell, Flex, useMantineTheme } from "@mantine/core";
22
import Footer from "../Footer";
3+
import TechnologiesSection, { mocData } from "../TechnologiesSection /TechnologiesSection";
4+
import { SectionContainer } from "./layout";
5+
36

4-
const mockdata = [
5-
{ link: '#', label: 'Contact' },
6-
{ link: '#', label: 'Privacy' },
7-
{ link: '#', label: 'Blog' },
8-
{ link: '#', label: 'Careers' },
9-
]
107
function HomePage() {
11-
8+
const theme = useMantineTheme();
129
return (
13-
<AppShell header={{ height: 'auto' }} footer={{ height: 'auto' }} padding="md">
10+
<AppShell header={{ height: 60 }}>
1411

15-
<AppShell.Header pos="sticky">
16-
<AppShell.Section mx="auto" px="md" py="md" style={{maxWidth: 1440}}>Header</AppShell.Section>
12+
<AppShell.Header>
13+
<SectionContainer>
14+
Header
15+
</SectionContainer>
1716
</AppShell.Header>
1817

19-
<AppShell.Main mx="auto" px="md" py={0} style={{maxWidth: 1440}}>Main</AppShell.Main>
18+
<AppShell.Main >
19+
<SectionContainer>
20+
<TechnologiesSection technologies={mocData}/>
21+
</SectionContainer>
22+
</AppShell.Main>
2023

21-
<AppShell.Footer>
22-
<Footer/>
24+
<AppShell.Footer pos="relative">
25+
<SectionContainer>
26+
<Footer/>
27+
</SectionContainer>
2328
</AppShell.Footer>
2429

2530
</AppShell>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { AppShell } from '@mantine/core';
2+
3+
export function SectionContainer({ children, ...props }) {
4+
return (
5+
<AppShell.Section
6+
mx="auto"
7+
px="md"
8+
style={{ maxWidth: 1440 }}
9+
{...props}
10+
>
11+
{children}
12+
</AppShell.Section>
13+
);
14+
}

frontend/src/components/TechnologiesSection /TechnologiesSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const mocData: TechnologyCategory[] = [
3535

3636
function TechnologiesSection({ technologies }: { technologies: TechnologyCategory[] }) {
3737
return (
38-
<Box component="section" p="md">
38+
<Box component="section">
3939
<Title order={2} mb="xl">
4040
Технологии
4141
</Title>

frontend/src/pages/Layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function PageLayout() {
2323
function AwaitUserData({ children }) {
2424
const userSlice = useSelector((state: RootReducerType) => state.user);
2525

26-
if (userSlice.status === 'fullfilled') {
26+
if (userSlice.status === 'fulfilled') {
2727
return children;
2828
}
2929

frontend/src/slices/userSlice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const userSlice = createSlice({
3535
})
3636
.addCase(fetchUserData.fulfilled, (state, { payload }) => {
3737
state.userInfo = payload.currentUser;
38-
state.status = 'fullfilled';
38+
state.status = 'fulfilled';
3939
});
4040
},
4141
});

frontend/src/types/slices.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export type ModalStateType = {
8585
item: Partial<ISnippet> | null;
8686
};
8787

88-
type Statuses = 'empty' | 'fullfilled' | 'pending' | 'rejected';
88+
type Statuses = 'empty' | 'fulfilled' | 'pending' | 'rejected';
8989

9090
export interface SnippetOwnerType {
9191
created_at: string;

frontend/yarn.lock

Lines changed: 2138 additions & 1930 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)