Skip to content

Commit c0fbf2f

Browse files
committed
box
1 parent f136334 commit c0fbf2f

File tree

7 files changed

+88
-10
lines changed

7 files changed

+88
-10
lines changed

public/lines.svg

+17
Loading

public/star.svg

+6
Loading

public/waves.svg

+14
Loading

src/components/common/Box.tsx

+22-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
1+
import { ReactNode } from 'react';
12
import {styled, theme} from 'stitches-config';
23

3-
export const Box = styled('div', {
4+
const ForegroundBox = styled('div', {
5+
position: 'relative',
46
border: '1px solid',
57
borderColor: theme.colors.neutral900,
68
borderRadius: theme.radii.medium,
79
padding: '32px',
8-
});
10+
zIndex: '1',
11+
});
12+
13+
const BackgroundBox = styled('div', {
14+
});
15+
16+
type BoxProps = {
17+
children: ReactNode;
18+
}
19+
20+
export function Box({ children }: BoxProps) {
21+
return (
22+
<BackgroundBox>
23+
<ForegroundBox>
24+
{children}
25+
</ForegroundBox>
26+
</BackgroundBox>
27+
)
28+
}

src/components/home/configure/Submit.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const GoSection = styled(Common.Box, {
1616
export function Submit() {
1717
return (
1818
<GoSection>
19-
<Common.Text size='h3' as='h3'>Ready to go?</Common.Text>
19+
<Common.Text size='h3' as='h3' css={{color: theme.colors.green800}}>Ready to go?</Common.Text>
2020
<Common.Button type='primary' arrow>Proceed</Common.Button>
2121
</GoSection>
2222
)

src/components/home/hero/HeroSection.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export function HeroSection() {
2828
<Container>
2929
<Hero.Notifications />
3030
<Common.Text size='h1' as='h1' css={{maxWidth: '400px'}}>Keep your community informed</Common.Text>
31+
<Hero.Notifications />
3132
</Container>
3233
</Section>
3334
);

src/components/home/hero/Notifications.tsx

+27-7
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ const NotificationsSection = styled('div', {
3232
const NotificationsWrap = styled('div');
3333

3434
export function Notifications() {
35-
const [transform, setTransform] = useState(false);
36-
37-
const [notifications] = useState([
35+
const [notifications, setNotifications] = useState([
3836
{
3937
name: 'Test1',
4038
},
@@ -53,19 +51,41 @@ export function Notifications() {
5351
{
5452
name: 'Test6',
5553
},
54+
{
55+
name: 'Test7',
56+
},
57+
{
58+
name: 'Test8',
59+
},
60+
{
61+
name: 'Test9',
62+
},
63+
{
64+
name: 'Test10',
65+
},
66+
{
67+
name: 'Test11',
68+
},
69+
{
70+
name: 'Test12',
71+
},
5672
]);
5773

58-
useEffect(() => {
74+
/* useEffect(() => {
5975
const interval = setInterval(() => {
60-
setTransform(!transform);
76+
const state = notifications;
77+
state.unshift(state.pop());
78+
79+
setNotifications(state);
80+
console.log(notifications);
6181
}, 2000);
6282
6383
return () => clearInterval(interval);
64-
});
84+
}, [notifications]); */
6585

6686
return (
6787
<NotificationsSection>
68-
<NotificationsWrap css={{transform: `translateY(${transform ? '124px' : '0'})`}}>
88+
<NotificationsWrap>
6989
{notifications.map((user, index) => (<Notification key={index} name={user.name} />))}
7090
</NotificationsWrap>
7191
</NotificationsSection>

0 commit comments

Comments
 (0)