Skip to content

Commit

Permalink
refactor: migrate footer
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Mar 3, 2024
1 parent d145839 commit 5f5faab
Show file tree
Hide file tree
Showing 6 changed files with 271 additions and 205 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
"@techstack/styled-system": "~1.0.341",
"@tippyjs/react": "~4.2.6",
"@vercel/analytics": "~1.1.1",
"babel-plugin-styled-components": "~2.1.4",
"beauty-error": "~1.2.18",
"cssnano": "~6.0.2",
"cssnano-preset-advanced": "~6.0.2",
Expand Down
54 changes: 30 additions & 24 deletions src/components/elements/Button/ButtonBase.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
import styled from 'styled-components'
import { transition } from 'theme'
import { transition, themeCss } from 'theme'
import Text from '../Text'

const Button = styled(Text)({
transition: `background-color ${transition.medium}, color ${transition.medium}, box-shadow ${transition.medium}`,
appearance: 'none',
display: 'inline-block',
textAlign: 'center',
lineHeight: 16 / 14,
textDecoration: 'none',
verticalAlign: 'middle',
WebkitFontSmoothing: 'antialiased',
whiteSpace: 'nowrap',
outline: 0,
'&:hover': {
cursor: 'pointer'
}
})
const Button = styled(Text).withConfig({
shouldForwardProp: prop => !['color', 'bg'].includes(prop)
})(
{
transition: `background-color ${transition.medium}, color ${transition.medium}, box-shadow ${transition.medium}`,
appearance: 'none',
display: 'inline-block',
textAlign: 'center',
lineHeight: 16 / 14,
textDecoration: 'none',
verticalAlign: 'middle',
WebkitFontSmoothing: 'antialiased',
whiteSpace: 'nowrap',
outline: 0,
'&:hover': {
cursor: 'pointer'
}
},
themeCss({
fontFamily: 'sans',
fontSize: 1,
fontWeight: 'bold',
px: 3,
py: 2,
border: 0,
borderRadius: 2
})
)

Button.defaultProps = {
as: 'button',
fontFamily: 'sans',
fontSize: 1,
fontWeight: 'bold',
px: 3,
py: 2,
color: 'white',
bg: 'link',
border: 0,
borderRadius: 2
bg: 'link'
}

export default Button
56 changes: 30 additions & 26 deletions src/components/elements/Input/Input.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
import { transition, colors, borders } from 'theme'
import { transition, colors, borders, themeCss } from 'theme'
import React, { useMemo, useState } from 'react'
import styled, { css } from 'styled-components'

import Text from '../Text'
import Flex from '../Flex'

const InputBase = styled(Text)({
maxWidth: '100%',
display: 'inline-block',
verticalAlign: 'middle',
border: 0,
appearance: 'none',
'&:focus': {
outline: '0'
const InputBase = styled(Text)(
{
maxWidth: '100%',
display: 'inline-block',
verticalAlign: 'middle',
appearance: 'none',
'&:focus': {
outline: '0'
},
'&:disabled': {
opacity: 1 / 4
}
},
'&:disabled': {
opacity: 1 / 4
}
})
themeCss({
lineHeight: 'inherit',
border: 0,
p: 0,
mx: 2,
color: 'inherit',
bg: 'transparent'
})
)

InputBase.defaultProps = {
as: 'input',
type: 'text',
lineHeight: 'inherit',
width: 1,
border: 0,
p: 0,
mx: 2,
color: 'inherit',
bg: 'transparent'
type: 'text'
}

const focusStyle = css`
Expand Down Expand Up @@ -77,13 +79,15 @@ const Input = ({
return (
<InputWrapper
as='label'
alignItems='center'
borderRadius={2}
focus={isFocus}
isDark={isDark}
py='12px'
pl={2}
pr={suggestions ? 0 : 2}
css={themeCss({
pr: suggestions ? 0 : 2,
py: '12px',
pl: 2,
alignItems: 'center',
borderRadius: 2
})}
>
{Icon && <Flex>{Icon}</Flex>}
<InputBase
Expand Down
7 changes: 3 additions & 4 deletions src/components/elements/Link/solid.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import styled, { css } from 'styled-components'
import { createCssState } from 'helpers/style'
import { textGradient, colors } from 'theme'
import { textGradient, colors, themeCss } from 'theme'
import { lighten } from 'polished'

import Box from '../Box'
Expand Down Expand Up @@ -56,15 +56,14 @@ LinkSolidWrapper.defaultProps = {
fontWeight: 'regular'
}

const LinkSolid = ({ fontWeight, href, children, color, theme, ...props }) => {
const LinkSolid = ({ href, children, theme, ...props }) => {
return (
<Box display='inline'>
<LinkSolidWrapper
{...props}
color={color}
href={href}
fontWeight={fontWeight}
isDark={theme === 'dark'}
css={themeCss({ fontWeight: 'regular' })}
>
{children}
</LinkSolidWrapper>
Expand Down
Loading

0 comments on commit 5f5faab

Please sign in to comment.