Skip to content

Commit

Permalink
refactor!: remove unused component and restructure file folder
Browse files Browse the repository at this point in the history
  • Loading branch information
chornos13 committed Feb 12, 2021
1 parent ee12618 commit bf05f8d
Show file tree
Hide file tree
Showing 23 changed files with 16 additions and 541 deletions.
2 changes: 1 addition & 1 deletion src/components/BaseHeader/BaseHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { ReactNode } from 'react'
import Content, { ContentProps } from 'components/Content/Content'
import cssHeader from 'layouts/containers/Public/Header/Header.module.scss'
import { Row } from 'antd'
import cx from 'shortcuts/cx'
import cx from 'classnames'

interface BaseHeaderProps extends ContentProps {
children?: ReactNode
Expand Down
File renamed without changes.
9 changes: 7 additions & 2 deletions src/components/Content/Content.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
@import 'src/styles/breakpoints';
@import 'src/styles/mixins';
@import 'src/styles/vars';

$xs: 576px;

@mixin xs {
@media (max-width: #{$xs}) {
@content;
}
}
.section {
max-width: $max-width;
margin: auto;
Expand Down
25 changes: 4 additions & 21 deletions src/components/Content/Content.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,8 @@
import React, { CSSProperties, ReactNode } from 'react'
import PropTypes from 'shortcuts/PropTypes'
import cx from 'shortcuts/cx'
import cx from 'classnames'
import cssContent from 'components/Content/Content.module.scss'
import { ReactComponentLike } from 'prop-types'

export function Section(props) {
const { children, ...comProps } = props
return <section {...comProps}>{children}</section>
}

Section.propTypes = {
children: PropTypes.node,
}

export function Div(props) {
const { children, ...comProps } = props
return <div {...comProps}>{children}</div>
}

Div.propTypes = {
children: PropTypes.node,
}

export interface ContentProps {
id?: string
classNameContainer?: string
Expand All @@ -35,12 +16,14 @@ export interface ContentProps {
component?: ReactComponentLike
}

const DefaultComponent = (props) => <section {...props} />

function Content(props: ContentProps) {
const {
classNameContainer,
styleContainer,
children,
component: Component = Section,
component: Component = DefaultComponent,
isMobile = false,
className,
style,
Expand Down
15 changes: 0 additions & 15 deletions src/components/DividerCard/DividerCard.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/HamburgerButton/HamburgerButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useRef, useState } from 'react'
import cx from 'shortcuts/cx'
import cx from 'classnames'
import cssHamburgerMenu from 'components/HamburgerButton/HamburgerButton.module.scss'
import { Dropdown } from 'antd'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
useTable,
} from 'react-table'
import Text from 'components/Typography/Text'
import cx from 'shortcuts/cx'
import cx from 'classnames'
import { Spin } from 'antd'
import cssTable from './Table.module.scss'

Expand Down
67 changes: 0 additions & 67 deletions src/css/cssFont.scss

This file was deleted.

34 changes: 0 additions & 34 deletions src/fields/ErrorView/withTitleAndError.js

This file was deleted.

28 changes: 0 additions & 28 deletions src/fields/ErrorView/withTitleAndError.module.scss

This file was deleted.

File renamed without changes.
2 changes: 0 additions & 2 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import getSiteLayout from 'layouts/core/DefaultLayout'
import Head from 'next/head'
import 'styles/vars.scss'
import 'styles/global.scss'
import 'styles/_breakpoints.scss'
import 'styles/_mixins.scss'

const title = 'Nexys'
const description = 'Nexys Boilerplate By Chornos13'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/formik/basic-input.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BasicInput from 'views/Formik/BasicInput/BasicInput'
import React from 'react'
import withCodeViewer from 'HOC/withCodeViewer'
import getSourceCode from 'helpers/getSourceCode'
import getSourceCode from 'components/CodeViewer/getSourceCode'

export async function getStaticProps() {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/react-query/basic-view-data.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BasicViewData from 'views/ReactQuery/BasicViewData/BasicViewData'
import React from 'react'
import withCodeViewer from 'HOC/withCodeViewer'
import getSourceCode from 'helpers/getSourceCode'
import getSourceCode from 'components/CodeViewer/getSourceCode'

export async function getStaticProps() {
return {
Expand Down
5 changes: 0 additions & 5 deletions src/shortcuts/Media.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/shortcuts/PropTypes.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/shortcuts/Typography.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/shortcuts/cx.ts

This file was deleted.

Loading

0 comments on commit bf05f8d

Please sign in to comment.