Skip to content

Commit 2b9c109

Browse files
committed
system that makes a bit more sense
1 parent a15cfa5 commit 2b9c109

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

components/slack/arrows.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function LeftArrow() {
1717
placeItems: 'center',
1818
display: 'flex',
1919
mr: 2,
20-
ml: 'calc(50vw - 35rem)'
20+
ml: 'calc(50vw - 36rem)'
2121
}}
2222
>
2323
<Icon glyph="view-back" size={32} color="white" />

components/slack/project.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
import { Box, Image, Text } from 'theme-ui'
1+
import { Box, Grid, Image, Text } from 'theme-ui'
22
import { VisibilityContext } from 'react-horizontal-scrolling-menu'
33
import { useContext } from 'react'
44

55
export default function Project({ title, description, color, img, itemId }) {
66
const visible = useContext(VisibilityContext)
77
const isVisible = visible.isItemVisible(itemId)
88

9-
console.log(itemId)
10-
119
return (
12-
<Box
10+
<Grid
1311
sx={{
14-
display: 'grid',
1512
borderRadius: 12,
13+
gridTemplateColumns: 'auto ',
1614
my: '2rem',
1715
backgroundImage: t =>
1816
`linear-gradient(to bottom, ${color[0]}, ${color[1]})`,
@@ -23,17 +21,19 @@ export default function Project({ title, description, color, img, itemId }) {
2321
transition: '700ms cubic-bezier(0.075, 0.02, 0.165, 1)',
2422
transformOrigin: 'center',
2523
mx: 16,
26-
ml: `${itemId === 0 && 'calc(50vw - 35rem)'}`
24+
ml: `${itemId === 0 && 'calc(50vw - 36rem)'}`
2725
}}
2826
itemId={itemId}
2927
>
3028
<Box
3129
sx={{
3230
paddingX: '16px',
33-
marginTop: ['6.25rem', '12.5rem'],
3431
display: 'flex',
3532
flexDirection: 'column',
36-
alignItems: 'center'
33+
placeItems: 'center',
34+
height: ['12.5rem', '20rem'],
35+
placeSelf: 'center',
36+
placeContent: 'end',
3737
}}
3838
>
3939
<Text
@@ -60,9 +60,9 @@ export default function Project({ title, description, color, img, itemId }) {
6060
sx={{
6161
visibility: ['hidden', 'visible'],
6262
height: '100%',
63-
objectFit: 'cover'
63+
objectFit: 'cover',
6464
}}
6565
/>
66-
</Box>
66+
</Grid>
6767
)
6868
}

pages/slack.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Meta from '@hackclub/meta'
22
import Head from 'next/head'
33
import { Box, Container, Heading, Text } from 'theme-ui'
4-
import { useRef } from 'react'
4+
import { useRef, useState, useEffect, useCallback } from 'react'
55
import { ScrollMenu } from 'react-horizontal-scrolling-menu'
66
import 'react-horizontal-scrolling-menu/dist/styles.css'
77

@@ -16,11 +16,9 @@ import Header from '../components/slack/header'
1616
import Project from '../components/slack/project'
1717
import Quote from '../components/slack/quote'
1818
import Arrows from '../components/slack/arrows'
19-
import usePreventScroll from '../components/slack/preventScroll'
2019

2120
const SlackPage = () => {
2221
const nameInputRef = useRef(null)
23-
const { disableScroll, enableScroll } = usePreventScroll()
2422

2523
return (
2624
<>
@@ -84,11 +82,13 @@ const SlackPage = () => {
8482
backgroundColor: '#F9FAFC',
8583
paddingT: '1rem'
8684
}}
87-
onMouseEnter={disableScroll}
88-
onMouseLeave={enableScroll}
8985
>
9086
<Box>
91-
<ScrollMenu Footer={Arrows} onWheel={onWheel}>
87+
<ScrollMenu
88+
Footer={Arrows}
89+
onWheel={onWheel}
90+
style={{ scrollbar: 'hidden' }}
91+
>
9292
{projects.map(project => (
9393
<Project
9494
title={project.title}

0 commit comments

Comments
 (0)