Skip to content

Commit

Permalink
refactor: tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Nov 25, 2023
1 parent 19901eb commit 27f448d
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 39 deletions.
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
"contributors": "(npx git-authors-cli && npx finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
"dev": "gatsby develop --host 0.0.0.0 --port 8000",
"lint": "standard-markdown README.md && standard",
"postinstall": "npm run transpile",
"postrelease": "npm run release:tags && npm run release:github",
"prebuild": "npm run build:data",
"predev": "npm run build:data",
Expand All @@ -217,6 +218,7 @@
"release:tags": "git push --follow-tags origin HEAD:master",
"storybook": "start-storybook -p 6006",
"test": "ava",
"transpile": "echo \"export { getApiUrl } from '@microlink/mql'\" | npx esbuild --bundle --format=esm --minify-whitespace --minify-identifiers > src/helpers/get-api-url.js",
"update": "ncu -i",
"update:check": "ncu -- --error-level 2"
},
Expand Down Expand Up @@ -249,10 +251,7 @@
},
"standard": {
"ignore": [
"src/components/hook/index.js",
"src/components/icons/index.js",
"src/helpers/hoc/index.js",
"src/helpers/style/index.js"
"src/helpers/get-api-url.js"
]
}
}
4 changes: 2 additions & 2 deletions src/helpers/mql-code.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import mql from '@microlink/mql'
import { getApiUrl } from './get-api-url'
import get from 'dlv'

const ENDPOINT = {
Expand Down Expand Up @@ -28,7 +28,7 @@ const endpoint = ({ endpoint, headers } = {}) => {
}

const createApiUrl = ({ url = 'https://example.com', ...props } = {}) => {
const [apiUrl] = mql.getApiUrl(url, props)
const [apiUrl] = getApiUrl(url, props)
return decodeURIComponent(apiUrl)
}

Expand Down
5 changes: 2 additions & 3 deletions src/pages/formats.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,8 @@ const FormatsPage = () => {
<Subhead>Anything else?</Subhead>
<Box p={[4, 4, 0, 0]}>
<Button
onClick={event =>
window.open(issueUrl.bug(), '_blank', 'noopener noreferrer')
}
onClick={() =>
window.open(issueUrl.bug(), '_blank', 'noopener noreferrer')}
>
<Caps>Request a format</Caps>
</Button>
Expand Down
64 changes: 36 additions & 28 deletions src/pages/oss.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import React from 'react'

export const Head = () => (
<Meta
title='Open Source Software'
description='Open Source Sustainability.'
image={cdnUrl('banner/oss.jpeg')}
/>
)

const OssPage = () => {
const repos = useOss()
const repositories = useOss()
return (
<DotsBackground alignItems='center' justifyContent='center'>
<Layout footer={{ bg: 'transparent' }}>
Expand Down Expand Up @@ -48,34 +49,41 @@ const OssPage = () => {
maxWidth={layout.normal}
flexDirection='column'
>
{repos.map(({ name, description, stars, issues, url }) => (
<Box key={name} mb={3} borderBottom={1} borderColor='black05'>
<Link color='black' href={url} icon={false}>
<Text
as='h3'
fontWeight='bold'
mr={3}
display='inline-block'
width='240px'
>
{name}
</Text>
<Flex color='black' style={{ float: 'right' }}>
<Flex alignItems='center' mr={3}>
<Text mr={1}>{formatNumber(stars)}</Text>
<StarIcon width='16px' />
{repositories.map(
({ name, description, stars, issues, url }, index) => (
<Box
key={name}
mb={index !== repositories.length - 1 ? 3 : 0}
borderBottom={1}
borderColor='black05'
>
<Link color='black' href={url} icon={false}>
<Text
as='h3'
fontWeight='bold'
mr={3}
display='inline-block'
width='240px'
>
{name}
</Text>
<Flex color='black' style={{ float: 'right' }}>
<Flex alignItems='center' mr={3}>
<Text mr={1}>{formatNumber(stars)}</Text>
<StarIcon width='16px' />
</Flex>
<Flex alignItems='center'>
<Text mr={1}>{issues}</Text>
<IssueIcon width='16px' />
</Flex>
</Flex>
<Flex alignItems='center'>
<Text mr={1}>{issues}</Text>
<IssueIcon width='16px' />
</Flex>
</Flex>
<Text color='black60' mt={2} mb={2} width='80%'>
{description}
</Text>
</Link>
</Box>
))}
<Text color='black60' mt={2} mb={2} width='80%'>
{description}
</Text>
</Link>
</Box>
)
)}
</Flex>
</Flex>
</Layout>
Expand Down
3 changes: 1 addition & 2 deletions src/pages/user-agents.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ const UserAgentsPage = () => {
justifyContent='center'
defaultValue='User Agent'
onChange={value =>
setType(value === 'User Agent' ? 'user' : 'crawler')
}
setType(value === 'User Agent' ? 'user' : 'crawler')}
>
{['User Agent', 'Crawler Agent']}
</Toggle>
Expand Down

0 comments on commit 27f448d

Please sign in to comment.