Fixed stickers page file formating (#1366)

This commit is contained in:
Cral_Cactus 2024-09-08 02:43:54 +03:00 committed by GitHub
parent 76be590b89
commit cae41fe37e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,6 +13,13 @@ import { startCase } from 'lodash'
const color = '#EC37AD' const color = '#EC37AD'
function customStartCase(st) {
return st
.replace(/\.(svg|png)$/, '')
.replace(/[_-]+/g, ' ')
.replace(/\b\w/g, char => char.toUpperCase());
}
const StickersPage = ({ stickers = [] }) => [ const StickersPage = ({ stickers = [] }) => [
<Box as="main" key="main" sx={{ textAlign: 'center' }}> <Box as="main" key="main" sx={{ textAlign: 'center' }}>
<ForceTheme theme="dark" /> <ForceTheme theme="dark" />
@ -149,7 +156,7 @@ const StickersPage = ({ stickers = [] }) => [
alt={st.split('.')[0]} alt={st.split('.')[0]}
/> />
<Text as="span" variant="caption" sx={{ fontSize: 2, mt: [2, 3] }}> <Text as="span" variant="caption" sx={{ fontSize: 2, mt: [2, 3] }}>
{startCase(st.replace(/\.(svg|png)/, ''))} {customStartCase(st)}
</Text> </Text>
</Flex> </Flex>
))} ))}