site/components/stat.js
Ella 89881fd7e8 Move /bank page to v3 (#167)
* initial migration

* port landing and feature components

* Features section

* Add event cards in Testimonials (no styles)

* add everything section

* everything but no styling

* fFix some styles in Everything.js

* Add Start section without the form yet

* Fix testimonials section grid

* Fix styles on Landing

* Styles on Everything section

* Fix testimonials cards

* Fix console error and testimonial cards

* Fix landing and style bugs

* Fix styles

* Add selection color

* Fix Grid on everything section

* Fetch transaction data from api

* Style stats

* Fix landing on mobile

* Fix some bugs and responsiveness

* Fix 🐛 so the form exists now

* Fix bugs & add timeline

* Fix Laptop in Grid

* Switch to Dark Laptop

* Fix Stat Text Size

* Form -> Airtable

* Change to hred to primary, align ModuleDetails card

* Remove dates

* Fix Event card to align items center

* Add mtop margin to transparency button

* Fix Run.js icon styles

* Make fiscal sponsor note more readable

* Add 2 tone colors btwn Start and Everything

* Flashing green dot

* Confusion

* Update components/bank/Timeline.js

Co-authored-by: Sam Poder <39828164+sampoder@users.noreply.github.com>

* Fix remaining style bugs

* small fix

* small fix

* Fix Form

* Fixes

- fix timeline horizontal
- green to hack club theme green
- more horizontal margin on everything section
- attempt to fix testimonial grid

* center 7 (percentage)

* Fix testimonial grid layout

* Fix landing

* Fix horizontal scroll on mobile

* Fix styles on event card

* Decrease font size and padding

* Actually fix it this time

* Fix styles

* Responsiveness and mobile styling

* Slight styles changes

* Fix Margins

* Neutralize

Co-authored-by: Sam Poder <39828164+sampoder@users.noreply.github.com>
2021-08-22 14:05:22 +08:00

88 lines
1.8 KiB
JavaScript

import { Flex, Text } from 'theme-ui'
import { isEmpty } from 'lodash'
const Stat = ({
value,
label,
unit = '',
color = 'text',
of,
center = false,
reversed = false,
half = false,
lg = false,
sm = false,
...props
}) => (
<Flex
{...props}
sx={{
fontFamily: 'heading',
flexDirection: reversed ? 'column-reverse' : 'column',
lineHeight: 1,
...props.sx
}}
>
<Flex
sx={{
alignItems: 'center',
justifyContent: center ? 'center' : 'start',
position: 'relative'
}}
>
<Text
as="span"
sx={{
color,
fontSize: lg ? [5, 6, 7] : sm ? [3, 4] : [4, 5, 6],
fontWeight: 'heading',
letterSpacing: 'title',
my: 0
}}
children={value || '—'}
/>
{!isEmpty(unit) && (
<Text
as="sup"
sx={{
fontSize: lg ? [2, 3] : sm ? [1, 1] : [1, 2],
color: color === 'text' ? 'secondary' : color,
ml: [null, unit === '%' ? 1 : null],
mr: [null, 1],
pt: [null, 1]
}}
children={unit}
/>
)}
{!isEmpty(of) && (
<Text
as="sup"
sx={{
fontSize: lg ? [2, 3] : [1, 2],
color: 'muted',
ml: [null, 1],
pt: [null, 1],
'::before': {
content: '"/"'
}
}}
children={of}
/>
)}
</Flex>
{!isEmpty(label) && (
<Text
as="span"
variant="caption"
sx={{
fontSize: lg ? [1, 2, 3] : [0, 1],
letterSpacing: 'headline',
textTransform: 'uppercase'
}}
children={label}
/>
)}
</Flex>
)
export default Stat