feat: first

This commit is contained in:
EleanorMao 2023-04-22 23:00:38 +08:00
parent edf473c172
commit 5ae1d9c5b2
44 changed files with 10913 additions and 16089 deletions

3
.gitignore vendored
View File

@ -21,3 +21,6 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.idea

35
NOTE.md Normal file
View File

@ -0,0 +1,35 @@
# Responsive
# Basic Components
* [x] Typography
* [] Link - fontSize todo
* [x] Button
* [] IconButton
* [x] TextButton
* [x] Modal
* [x] Step
* [x] Tooltip
* [x] Tag
* Hamburger Menu - 需要手写!
# Form Components
* Input
* Password Input with Eye Icon
* Radio Group
* Vertical Layout
* Horizontal Layout
* Checkbox
* Textarea
* Select
* Captcha Input - 需要找别的组件!
* Form
* FormItem
* FormItem with Validate Icon
* FormItem with Help Icon
* FormItem with Error Message
# Layout Components
* Layout
* Header
* Footer

View File

@ -6,7 +6,7 @@ This project was bootstrapped with [Create React App](https://github.com/faceboo
In the project directory, you can run:
### `npm start`
### `yarn start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
@ -14,12 +14,12 @@ Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.\
You will also see any lint errors in the console.
### `npm test`
### `yarn test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
### `yarn build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
@ -29,7 +29,7 @@ Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
### `yarn eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**

15920
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,22 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@ant-design/static-style-extract": "^1.0.1",
"@types/ua-parser-js": "^0.7.36",
"antd": "^5.4.4",
"dayjs": "^1.11.7",
"mobx": "^6.9.0",
"mobx-react-lite": "^3.4.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.10.0",
"react-scripts": "5.0.1",
"styled-components": "^5.3.9",
"typeface-lato": "^1.1.13",
"typescript": "^4.9.5",
"ua-parser-js": "^1.0.35"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
@ -10,13 +26,14 @@
"@types/node": "^16.18.24",
"@types/react": "^18.0.37",
"@types/react-dom": "^18.0.11",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4"
"@types/styled-components": "^5.1.26",
"cross-env": "^7.0.3",
"ts-node": "^10.9.1",
"tslib": "^2.5.0"
},
"scripts": {
"prestart": "ts-node --project ./tsconfig.node.json ./scripts/genAntdCss.tsx",
"prebuild": "cross-env NODE_ENV=production ts-node --project ./tsconfig.node.json ./scripts/genAntdCss.tsx",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",

1
public/antd.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -2,42 +2,12 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="shortcut icon" href="//cdn.shopify.com/s/files/1/0428/9406/5826/files/ihealth-favicon-1_32x32.png?v=1613764357" type="image/png">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>iHealth</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -1,25 +0,0 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

80
scripts/genAntdCss.tsx Normal file
View File

@ -0,0 +1,80 @@
import { extractStyle } from '@ant-design/static-style-extract';
import { ConfigProvider } from 'antd';
import fs from 'fs';
import React from 'react';
const outputPath = './src/styles/antd.min.css';
const brandPrimary = '#FF5200';
const textPrimary = '#1E1D1F'
const textDarker = '#000022'
const textLighter = '#8F9296'
const white = '#FDFDFD'
const css = extractStyle((node) => (
<ConfigProvider
theme={{
token: {
colorBgMask: 'rgba(217, 217, 217, 0.65)',
colorLink: brandPrimary,
colorLinkHover: brandPrimary,
colorLinkActive: brandPrimary,
colorPrimary: brandPrimary,
colorText: textPrimary,
colorTextBase: textPrimary,
fontSize: 16,
fontSizeHeading1: 28,
fontSizeHeading2: 22,
fontSizeHeading3: 20,
lineHeightHeading1: 1.3,
lineHeightHeading2: 1.3,
lineHeightHeading3: 1.3,
fontSizeHeading4: 16,
fontFamily: 'Lato, Helvetica, Arial, sans-serif'
},
components: {
Button: {
// button base
fontSize: 20,
borderRadius: 4,
controlHeight: 45,
lineHeight: 45 / 20,
controlOutlineWidth: 0,
controlOutline: 'transparent',
// primary button
colorPrimary: '#FF5A0C',
colorTextLightSolid: white,
colorPrimaryHover: brandPrimary,
colorPrimaryActive: brandPrimary,
// disabled button
colorBgContainerDisabled: '#CACACC',
colorTextDisabled: white,
// text button
colorText: brandPrimary,
colorBgTextHover: 'transparent',
colorBgTextActive: 'transparent',
},
Modal: {
borderRadiusLG: 10,
boxShadow: '2px 2px 4px 1px rgba(0, 0, 0, 0.2)',
paddingContentHorizontalLG: 32,
},
Tooltip: {
fontSize: 14,
paddingSM: 12,
paddingXS: 10,
borderRadius: 4,
colorTextLightSolid: textDarker,
colorBgDefault: white,
},
Steps: {
colorSplit: brandPrimary,
colorTextDescription: textLighter,
}
}
}}
>
{node}
</ConfigProvider>
));
fs.writeFileSync(outputPath, css);

View File

@ -1,38 +0,0 @@
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

View File

@ -1,9 +0,0 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});

View File

@ -1,25 +1,97 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
import { BreakpointProvider } from './components/Breakpoint'
import { ConfigProvider } from 'antd'
import { Steps } from './components/Steps'
const brandPrimary = '#FF5200';
const textPrimary = '#1E1D1F'
const textDarker = '#000022'
const textLighter = '#8F9296'
const white = '#FDFDFD'
function App() {
const items = [
{
title: 'Account',
},
{
title: 'Tester Info',
},
{
title: 'Review',
},
{
title: 'Done',
},
];
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
<ConfigProvider
theme={{
token: {
colorBgMask: 'rgba(217, 217, 217, 0.65)',
colorLink: brandPrimary,
colorLinkHover: brandPrimary,
colorLinkActive: brandPrimary,
colorPrimary: brandPrimary,
colorText: textPrimary,
colorTextBase: textPrimary,
fontSize: 16,
fontSizeHeading1: 28,
fontSizeHeading2: 22,
fontSizeHeading3: 20,
lineHeightHeading1: 1.3,
lineHeightHeading2: 1.3,
lineHeightHeading3: 1.3,
fontSizeHeading4: 16,
fontFamily: 'Lato, Helvetica, Arial, sans-serif'
},
components: {
Button: {
// button base
fontSize: 20,
borderRadius: 4,
controlHeight: 45,
lineHeight: 45 / 20,
controlOutlineWidth: 0,
controlOutline: 'transparent',
// primary button
colorPrimary: '#FF5A0C',
colorTextLightSolid: white,
colorPrimaryHover: brandPrimary,
colorPrimaryActive: brandPrimary,
// disabled button
colorBgContainerDisabled: '#CACACC',
colorTextDisabled: white,
// text button
colorText: brandPrimary,
colorBgTextHover: 'transparent',
colorBgTextActive: 'transparent',
},
Modal: {
borderRadiusLG: 10,
boxShadow: '2px 2px 4px 1px rgba(0, 0, 0, 0.2)',
paddingContentHorizontalLG: 32,
},
Tooltip: {
fontSize: 14,
paddingSM: 12,
paddingXS: 10,
borderRadius: 4,
colorTextLightSolid: textDarker,
colorBgDefault: white,
},
Steps: {
colorSplit: brandPrimary,
colorTextDescription: textLighter,
}
}
}}
>
Learn React
</a>
</header>
</div>
<BreakpointProvider>
<div>iHealth</div>
<Steps current={1} items={items} />
</BreakpointProvider>
</ConfigProvider>
);
}

View File

@ -0,0 +1,8 @@
import React, { FC, PropsWithChildren } from 'react'
import { BreakpointProps, useBreakpoint } from './useBreakpoint'
export const Breakpoint: FC<PropsWithChildren<BreakpointProps>> = ({ children, ...props }) => {
const enabled = useBreakpoint(props)
return enabled ? <>{children}</> : null
}

View File

@ -0,0 +1,25 @@
import React, { FC, PropsWithChildren } from 'react'
import { Size, useSize } from './useSize'
export const breakpointList = {
xs: 0,
s: 576,
m: 768,
l: 992,
xl: 1200,
}
export interface BreakpointContextProps {
size: Size,
breakpointList: typeof breakpointList
}
export const BreakpointContext = React.createContext<BreakpointContextProps>({ breakpointList, size: {} } as any)
export const BreakpointProvider: FC<PropsWithChildren> = ({ children }) => {
const size = useSize()
return (
<BreakpointContext.Provider value={{ size, breakpointList }}>{children}</BreakpointContext.Provider>
)
}

View File

@ -0,0 +1,3 @@
export { BreakpointProvider } from './BreakpointProvider'
export { useBreakpoint } from './useBreakpoint'
export { Breakpoint } from './Breakpoint'

View File

@ -0,0 +1,81 @@
import { useContext } from 'react';
import { BreakpointContext } from './BreakpointProvider'
import { uaParser } from '../../utils/uaParser'
export interface DeviceType {
mobile?: boolean;
tablet?: boolean;
desktop?: boolean;
}
export interface OrientationType {
landscape?: boolean
portrait?: boolean
}
export interface Breakpoints {
xs?: boolean
s?: boolean
m?: boolean
l?: boolean
xl?: boolean
// greater than the width
up?: boolean
// less than the width
down?: boolean
width?: {
min?: number
max?: number
}
}
export type BreakpointProps = DeviceType & Breakpoints & OrientationType
const deviceType = ['mobile', 'tablet', 'desktop']
const currentDeviceType = ['mobile', 'tablet'].includes(uaParser.device.model || '') ? uaParser.device.model : 'desktop'
function matchWidth(width: number, min?: number, max?: number): boolean {
if (typeof min === 'number' && typeof max === 'number') {
return width >= min && width <= max
}
if (typeof min === 'number') {
return width >= min
}
if (typeof max === 'number') {
return width <= max
}
return false
}
export const useBreakpoint = (props: BreakpointProps): boolean => {
const { breakpointList, size: { orientation, ...size } } = useContext(BreakpointContext)
let enabled: boolean
const allKeys = Object.keys(props)
const keysWithoutDeviceType = allKeys.filter(key => !deviceType.includes(key))
const keysWithDeviceType = allKeys.filter(key => deviceType.includes(key))
enabled = keysWithoutDeviceType.every(key => {
if (typeof breakpointList[key as keyof typeof breakpointList] === 'number' && !props.width) {
if (props.up) {
return size.width > breakpointList[key as keyof typeof breakpointList]
}
if (props.down) {
return size.width <= breakpointList[key as keyof typeof breakpointList]
}
return size.width === breakpointList[key as keyof typeof breakpointList]
}
if (key === 'width') {
return matchWidth(3000, props.width?.min, props.width?.max)
}
if (key === 'landscape' || key === 'portrait') {
return key === orientation
}
return true
}) && (keysWithDeviceType.length ? keysWithDeviceType.some(key => currentDeviceType === key) : true)
return enabled
}

View File

@ -0,0 +1,56 @@
import { useCallback, useLayoutEffect, useState } from 'react'
type Orientation = "portrait" | "landscape"
function getOrientation(): Orientation {
if (
window.screen.orientation &&
Object.prototype.hasOwnProperty.call(window, 'onorientationchange')
) {
return window.screen.orientation.type.includes('portrait') ? 'portrait' : 'landscape'
}
if (
Object.prototype.hasOwnProperty.call(window, 'orientation')
) {
return Math.abs(window.orientation) !== 90 ? 'portrait' : 'landscape'
}
return window.innerHeight / window.innerWidth > 1 ? "portrait" : "landscape"
}
export interface Size {
width: number
height: number
orientation: Orientation
}
export function useSize():Size {
const [width, setWidth] = useState<number>(document.documentElement.clientWidth)
const [height, setHeight] = useState<number>(document.documentElement.clientHeight)
const [orientation, setOrientation] = useState<Orientation>(getOrientation())
const resizeListener = useCallback(() => {
setWidth(document.documentElement.clientWidth)
setHeight(document.documentElement.clientHeight)
}, [])
const orientationListener =useCallback( () => {
setOrientation(getOrientation())
},[])
useLayoutEffect(() => {
window.addEventListener('resize', resizeListener)
window.addEventListener('orientationchange', orientationListener)
return () => {
window.removeEventListener('resize', resizeListener)
window.removeEventListener('orientationchange', orientationListener)
}
})
return {
width,
height,
orientation
}
}

View File

@ -0,0 +1,9 @@
import React, { FC } from 'react'
import { Button as AntdButton, ButtonProps as AntdButtonProps } from 'antd'
export type ButtonProps = Omit<AntdButtonProps, 'danger' | 'ghost' | 'shape' | 'size' | 'type'> & {
type?: 'primary' | 'link' | 'text'
}
export const Button: FC<ButtonProps> = (props) => {
return <AntdButton type="primary" {...props} />
}

View File

@ -0,0 +1 @@
export * from './Button'

View File

@ -0,0 +1,8 @@
import React, { FC } from 'react'
import { Modal as AntdModal, ModalProps as AntdModalProps } from 'antd'
import { ReactComponent as CloseIcon } from '../../icons/close.svg'
export type ModalProps = Omit<AntdModalProps, 'footer' | 'closeIcon' | 'title' | 'okText' | 'okType' | 'okButtonProps' | 'cancelText' | 'cancelButtonProps'>
export const Modal: FC<ModalProps> = (props) => {
return <AntdModal centered {...props} footer={null} closeIcon={<CloseIcon />} />
}

View File

@ -0,0 +1 @@
export * from './Modal'

View File

@ -0,0 +1,24 @@
import React, { FC, PropsWithChildren } from 'react'
import styled from 'styled-components'
const StyledStepIcon = styled.div<{ $active?: boolean }>`
background: ${props => props.$active ? '#FFAB83' : '#FFFFFF'};
border: 1px solid ${props => props.$active ? '#FFAB83' : '#FF5200'};
width: 24px;
height: 24px;
line-height: 24px;
margin-top: 0;
margin-bottom: 0;
margin-inline-start: 0;
margin-inline-end: 8px;
font-size: 12px;
color: #1E1D1F;
font-weight: 400;
text-align: center;
border-radius: 50%;
transition: background-color .3s, border-color .3s;
`
export const StepIcon: FC<PropsWithChildren<{ active: boolean }>> = ({ children, active }) => {
return <StyledStepIcon $active={active}>{children}</StyledStepIcon>
}

View File

@ -0,0 +1,43 @@
import React, { FC } from 'react'
import { Steps as AntdSteps, StepsProps as AntdStepsProps } from 'antd'
import { StepProps } from 'antd/es/steps'
import styled from 'styled-components'
import {StepIcon} from './StepIcon'
export type StepsProps = Omit<AntdStepsProps, 'labelPlacement' | 'size' | 'status' | 'type' | 'items'> & {
items: Omit<StepProps, 'icon' | 'description'>[]
}
const StyledSteps = styled(AntdSteps)`
&.ant-steps-label-vertical {
.ant-steps-item-content {
margin-top: 5px;
}
.ant-steps-item-tail {
top: 8px;
margin-inline-start: 53px;
padding: 4px 12px;
}
}
.ant-steps-item-title {
font-size: 12px;
line-height: 14px;
}
.ant-steps-item-finish > .ant-steps-item-container > .ant-steps-item-content > .ant-steps-item-title {
color: #8F9296;
}
`
export const Steps: FC<StepsProps> = ({ items, current = 0, ...props }) => {
const formattedItems = items.map((item, index) => {
return {
...item,
icon: <StepIcon active={index <= current}>{index + 1}</StepIcon>
}
})
return (
<StyledSteps labelPlacement="vertical" {...props} current={current} items={formattedItems} />
)
}

View File

@ -0,0 +1 @@
export * from './Steps'

View File

@ -0,0 +1,21 @@
import React, { PropsWithChildren } from 'react'
import styled from 'styled-components'
import {TinyText} from '../Typography'
const StyledTag = styled.div`
background: #FFAB83;
border-radius: 7px;
text-align: center;
height: 14px;
line-height: 14px;
display: inline-block;
> span {
position: relative;
display: inline-block;
top: -4px;
}
`
export const Tag: React.FC<PropsWithChildren> = (props) => {
return <StyledTag><TinyText>{props.children}</TinyText></StyledTag>
}

View File

@ -0,0 +1 @@
export * from './Tag'

View File

@ -0,0 +1,33 @@
import React, { FC, useCallback } from 'react'
import { Tooltip as AntdTooltip, TooltipProps as AntdTooltipProps } from 'antd'
import { ReactComponent as CloseIcon } from '../../icons/close.svg'
import styled from 'styled-components'
export type TooltipProps = AntdTooltipProps & { closeable?: boolean; primary?: boolean }
const Close = styled.span`
line-height: 17px;
vertical-align: middle;
cursor: pointer;
padding-left: 4px;
> svg {
width: 14px;
height: 14px;
line-height: 17px;
}
`
export const Tooltip: FC<TooltipProps> = ({ closeable, primary, title, overlayClassName, ...props }) => {
const handleClick = useCallback(() => {
document.documentElement.click()
}, [])
return (
<AntdTooltip
trigger="click"
overlayClassName={`health-tooltip${primary ? '-highlighted' : ''} ${overlayClassName || ''}`}
{...props}
title={<>{title} {closeable ? <Close><CloseIcon onClick={handleClick} /></Close> : null}</>}
/>
)
}

View File

@ -0,0 +1 @@
export * from './Tooltip'

View File

@ -0,0 +1,22 @@
import React, { FC, ComponentProps } from 'react'
import { Typography, TypographyProps } from 'antd'
import styled from 'styled-components'
type ButtonTextProps = ComponentProps<TypographyProps['Text']> & {
level?: 1 | 2
}
const StyledButtonText = styled(Typography.Text)<{ $level: 1 | 2 }>`
${props => props.$level === 1 ? `
font-weight: 500;
font-size: 20px;
line-height: 20px;
` : `
font-weight: 400;
font-size: 12px;
line-height: 14px;
`}
`
export const ButtonText: FC<ButtonTextProps> = ({ level = 1, ...props }) => {
return <StyledButtonText {...props} $level={level} />
}

View File

@ -0,0 +1,17 @@
import React, { FC, ComponentProps } from 'react'
import { Typography, TypographyProps } from 'antd'
import styled from 'styled-components'
type AdditionalParagraphProps = ComponentProps<TypographyProps['Paragraph']> & {
level?: 1 | 2
}
const StyledParagraph2 = styled(Typography.Paragraph)`
font-size: 12px;
`
export const Paragraph: FC<AdditionalParagraphProps> = ({ level = 1, ...props }) => {
if (level === 2) {
return <StyledParagraph2 {...props} />
}
return <Typography.Paragraph {...props} />
}

View File

@ -0,0 +1,16 @@
import React, { FC, ComponentProps } from 'react'
import { Typography, TypographyProps } from 'antd'
import styled from 'styled-components'
type TinyTextProps = ComponentProps<TypographyProps['Text']>
const StyledTinyText = styled(Typography.Text)`
font-weight: 400;
font-size: 12px;
transform: scale(0.66667);
line-height: 1.75;
color: #1E1D1F;
`
export const TinyText: FC<TinyTextProps> = (props) => {
return <StyledTinyText {...props} />
}

View File

@ -0,0 +1,8 @@
import { Typography } from 'antd'
const { Text, Title, Link } = Typography
export * from './Paragraph'
export * from './ButtonText'
export * from './TinyText'
export { Text, Title, Link }

3
src/icons/close.svg Normal file
View File

@ -0,0 +1,3 @@
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.29289 6.29289C6.68342 5.90237 7.31658 5.90237 7.70711 6.29289L16 14.5858L24.2929 6.29289C24.6834 5.90237 25.3166 5.90237 25.7071 6.29289C26.0976 6.68342 26.0976 7.31658 25.7071 7.70711L17.4142 16L25.7071 24.2929C26.0976 24.6834 26.0976 25.3166 25.7071 25.7071C25.3166 26.0976 24.6834 26.0976 24.2929 25.7071L16 17.4142L7.70711 25.7071C7.31658 26.0976 6.68342 26.0976 6.29289 25.7071C5.90237 25.3166 5.90237 24.6834 6.29289 24.2929L14.5858 16L6.29289 7.70711C5.90237 7.31658 5.90237 6.68342 6.29289 6.29289Z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 662 B

View File

@ -1,13 +0,0 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}

View File

@ -1,8 +1,10 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import 'typeface-lato'
import 'antd/dist/reset.css';
import './styles/antd.min.css';
import './styles/reset.css';
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
@ -12,8 +14,3 @@ root.render(
<App />
</React.StrictMode>
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -1,15 +0,0 @@
import { ReportHandler } from 'web-vitals';
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
});
}
};
export default reportWebVitals;

1
src/styles/antd.min.css vendored Normal file

File diff suppressed because one or more lines are too long

47
src/styles/reset.css Normal file
View File

@ -0,0 +1,47 @@
.ant-btn:not(.ant-btn-link):not(.ant-btn-text) {
font-weight: 500 !important;
}
.ant-btn-link, .ant-btn-text {
font-size: 12px;
line-height: 16px;
}
.ant-wave {
display: none !important;
}
.ant-typography h1 {
color: #1E1D1F;
}
.ant-modal .ant-modal-close {
top: 9px !important;
right: 9px !important;
color: #000022 !important;
}
.ant-modal .ant-modal-close:hover {
background: transparent !important;
}
.ant-modal .ant-modal-close-x {
font-size: 24px !important;
line-height: 1 !important;
}
.health-tooltip-highlighted.ant-tooltip .ant-tooltip-arrow:after {
box-shadow: 1px 1px 0 #FF5A0C;
}
.health-tooltip-highlighted.ant-tooltip .ant-tooltip-inner {
position: relative;
box-shadow: 1px 1px 0px 0 #FF5A0C, -1px -1px 0px 0 #FF5A0C, -1px 1px 0px 0 #FF5A0C, 1px -1px 0px 0 #FF5A0C;
}
.health-tooltip.ant-tooltip .ant-tooltip-arrow:after {
box-shadow: 1px 1px 0 #000022;
}
.health-tooltip.ant-tooltip .ant-tooltip-inner {
position: relative;
box-shadow: 0 2px 0px 0 #000022, 0 2px 0px 0px #000022, 1px 1px 0px 2px #000022;
}

3
src/utils/uaParser.ts Normal file
View File

@ -0,0 +1,3 @@
import UAParser from 'ua-parser-js'
export const uaParser = UAParser()

9
tsconfig.node.json Normal file
View File

@ -0,0 +1,9 @@
{
"compilerOptions": {
"strictNullChecks": true,
"module": "NodeNext",
"jsx": "react",
"esModuleInterop": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
}

10228
yarn.lock Normal file

File diff suppressed because it is too large Load Diff