♻️ Refactor

This commit is contained in:
Malted 2023-04-06 23:51:48 +01:00
parent 3341e42240
commit a4b53ea7a2
No known key found for this signature in database
GPG key ID: C1AF1C0E5180BE02
2 changed files with 10 additions and 10 deletions

View file

@ -1,8 +1,7 @@
import React, { useState } from 'react'
import React from 'react'
import { Box, Button, Text } from 'theme-ui'
import ReactTooltip from 'react-tooltip'
import Icon from '@hackclub/icons'
/** @jsxImportSource theme-ui */
export default function Buttons({
children,
@ -13,7 +12,7 @@ export default function Buttons({
primary,
...props
}) {
let fontWeight = primary != null ? '700' : '400'
let fontWeight = primary ? '700' : '400'
return (
<Box
@ -34,12 +33,12 @@ export default function Buttons({
alignItems: 'center',
color: 'inherit',
px: '3',
py: primary != null ? '12px' : 2,
py: primary ? '12px' : 2,
width: 'fit-content',
textTransform: 'none',
fontWeight: '400',
fontSize:
primary != null ? ['18px', '20px', '22px'] : [1, '16px', '18px'],
primary ? ['18px', '20px', '22px'] : [1, '16px', '18px'],
backdropFilter: 'blur(2px)',
fontWeight: fontWeight
}}

View file

@ -60,7 +60,8 @@ const CardModel = ({
{text || 'Happening now'}
</Box>
)}
{github_link != null ? (
{github_link && (
<Box>
{position === 'bottom' ? (
<Flex
@ -90,7 +91,7 @@ const CardModel = ({
}}
/>
</Link>
{stars != null ? (
{stars ? (
<Text as="h2">
<Comma>{stars}</Comma>
</Text>
@ -109,7 +110,7 @@ const CardModel = ({
// flexDirection: ['column', 'row', 'row']
}}
>
{stars != null ? (
{stars ? (
<Text as="h2" sx={{ fontSize: ['20px', '24px', '28px'] }}>
<Comma>{stars}</Comma>
</Text>
@ -132,9 +133,8 @@ const CardModel = ({
</Flex>
)}
</Box>
) : (
<></>
)}
{image && (
<Image
src={image}
@ -148,6 +148,7 @@ const CardModel = ({
mt: ['-24px', '-32px', '-32px', '-32px'],
zIndex: 0
}}
alt=''
/>
)}
{children}