Skip to content

Commit

Permalink
Make ParaTimeSelection padding match placeholder, option, and value
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaw3d committed Apr 25, 2023
1 parent c1585ec commit e0cc2dd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/pages/ParaTimesPage/ParaTimeSelection/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import React, { useContext } from 'react'
import { Box } from 'grommet/es6/components/Box'
import { Form } from 'grommet/es6/components/Form'
import { FormField } from 'grommet/es6/components/FormField'
Expand All @@ -9,16 +9,20 @@ import { ParaTimeContent } from '../ParaTimeContent'
import { ParaTimeFormFooter } from '../ParaTimeFormFooter'
import { useParaTimes } from '../useParaTimes'
import { useParaTimesNavigation } from '../useParaTimesNavigation'
import { ThemeContext } from 'styled-components'
import { ThemeType } from 'grommet/es6/themes'

type ParaTimeOptionProps = {
label: string
isEvm?: boolean
}
const ParaTimeOption = ({ label, isEvm }: ParaTimeOptionProps) => {
const theme = useContext<ThemeType>(ThemeContext)
const { t } = useTranslation()
const paddingToMatchPlaceholder = theme.global?.input?.padding

return (
<Box direction="row" justify="between" width="240px">
<Box direction="row" justify="between" width="240px" pad={paddingToMatchPlaceholder}>
<span>{label}</span>
{isEvm && <Text color="lightText">{t('paraTimes.selection.evmc', 'EVMc')}</Text>}
</Box>
Expand Down
8 changes: 8 additions & 0 deletions src/styles/theme/ThemeProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ const grommetCustomTheme: ThemeType = {
elevation: 'none',
},
},
select: {
options: {
container: {
// Remove padding to match ParaTimeOption when displayed as value and as option
pad: 'none',
},
},
},
global: {
colors: {
oasisIndigo: '#310081',
Expand Down

0 comments on commit e0cc2dd

Please sign in to comment.