Skip to content
This repository has been archived by the owner on Feb 18, 2022. It is now read-only.

Commit

Permalink
Replace export {} with direct exports
Browse files Browse the repository at this point in the history
  • Loading branch information
Reselim committed Nov 20, 2021
1 parent 9d29d3c commit 781a2e3
Show file tree
Hide file tree
Showing 38 changed files with 187 additions and 431 deletions.
5 changes: 2 additions & 3 deletions src/class/AABB.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Vector2 } from "@free-draw/moderation-client"

type AABBResult = {
export type AABBResult = {
min: Vector2,
max: Vector2,
}
Expand Down Expand Up @@ -43,5 +43,4 @@ class AABB {
}
}

export default AABB
export { AABBResult }
export default AABB
23 changes: 7 additions & 16 deletions src/components/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ReactDOM from "react-dom"
import styled from "styled-components"
import TextButtonComponent, { TextButtonOptions } from "./TextButton"

const DialogContainerElement = styled.div`
export const DialogContainerElement = styled.div`
position: fixed;
top: 0;
left: 0;
Expand All @@ -16,7 +16,7 @@ const DialogContainerElement = styled.div`
z-index: 100;
`

const DialogElement = styled.div`
export const DialogElement = styled.div`
display: flex;
flex-direction: column;
padding: 20px 0;
Expand All @@ -25,13 +25,13 @@ const DialogElement = styled.div`
width: 340px;
`

const DialogTitleElement = styled.span`
export const DialogTitleElement = styled.span`
font-size: 24px;
font-weight: 700;
margin: 0 25px;
`

const DialogDescriptionElement = styled.span`
export const DialogDescriptionElement = styled.span`
font-size: 15px;
font-weight: 400;
line-height: 20px;
Expand All @@ -42,7 +42,7 @@ const DialogDescriptionElement = styled.span`
}
`

const DialogEmbedElement = styled.div`
export const DialogEmbedElement = styled.div`
margin: 20px 25px 0;
z-index: 10;
Expand All @@ -51,7 +51,7 @@ const DialogEmbedElement = styled.div`
}
`

const DialogButtonsElement = styled.div`
export const DialogButtonsElement = styled.div`
display: flex;
flex-direction: row;
justify-content: flex-end;
Expand Down Expand Up @@ -112,13 +112,4 @@ function DialogComponent({ title, description, buttons, onCancel, children }: {
), document.body)
}

export default DialogComponent

export {
DialogContainerElement,
DialogElement,
DialogTitleElement,
DialogDescriptionElement,
DialogEmbedElement,
DialogButtonsElement,
}
export default DialogComponent
26 changes: 8 additions & 18 deletions src/components/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Arrow from "../assets/arrow.svg"

const height = 42

const DropdownItemElement = styled.div<{
export const DropdownItemElement = styled.div<{
isPrimary?: boolean,
isPlaceholder?: boolean,
}>`
Expand All @@ -26,7 +26,7 @@ const DropdownItemElement = styled.div<{
}
`

const DropdownItemNameElement = styled.span`
export const DropdownItemNameElement = styled.span`
margin-left: 12px;
font-size: 16px;
font-weight: 400;
Expand Down Expand Up @@ -59,7 +59,7 @@ function DropdownItemComponent({ isPrimary, name, icon, isPlaceholder, onClick }
)
}

const DropdownContainerElement = styled.div<{
export const DropdownContainerElement = styled.div<{
zIndex: number,
}>`
width: 100%;
Expand All @@ -68,7 +68,7 @@ const DropdownContainerElement = styled.div<{
z-index: ${props => props.zIndex};
`

const DropdownElement = styled.div`
export const DropdownElement = styled.div`
display: flex;
flex-direction: column;
width: 100%;
Expand All @@ -77,7 +77,7 @@ const DropdownElement = styled.div`
background: white;
`

const DropdownArrowElement = styled(Arrow)<{
export const DropdownArrowElement = styled(Arrow)<{
isOpen: boolean,
}>`
position: absolute;
Expand All @@ -91,9 +91,9 @@ const DropdownArrowElement = styled(Arrow)<{
${props => props.isOpen ? "transform: rotate(90deg)" : null};
`

const DropdownOptionsElement = styled.div``
export const DropdownOptionsElement = styled.div``

type DropdownOption = {
export type DropdownOption = {
id: any,
name: string,
}
Expand Down Expand Up @@ -149,14 +149,4 @@ function DropdownComponent({ options, currentOptionId, placeholder, index, onSel
)
}

export default DropdownComponent

export {
DropdownItemElement,
DropdownItemNameElement,

DropdownContainerElement,
DropdownElement,
DropdownArrowElement,
DropdownOptionsElement,
}
export default DropdownComponent
15 changes: 4 additions & 11 deletions src/components/Header/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from "styled-components"
import { Link, useRouteMatch } from "react-router-dom"
import colors from "../../presets/colors"

const NavigationButtonElement = styled(Link)<{
export const NavigationButtonElement = styled(Link)<{
isSelected: boolean,
}>`
position: relative;
Expand All @@ -27,7 +27,7 @@ const NavigationButtonElement = styled(Link)<{
}
`

const NavigationButtonTextElement = styled.span`
export const NavigationButtonTextElement = styled.span`
font-size: 17px;
font-weight: 300;
`
Expand All @@ -46,7 +46,7 @@ function NavigationButtonComponent({ text, path, exact }: {
)
}

const NavigationElement = styled.div`
export const NavigationElement = styled.div`
height: 100%;
margin: 0 32px;
display: flex;
Expand All @@ -66,11 +66,4 @@ function NavigationComponent() {
)
}

export default NavigationComponent

export {
NavigationButtonElement,
NavigationButtonTextElement,

NavigationElement,
}
export default NavigationComponent
20 changes: 6 additions & 14 deletions src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import API from "../../API"
import Logo from "../../assets/logo.svg"
import NavigationComponent from "./Navigation"

const HeaderElement = styled.div`
export const HeaderElement = styled.div`
position: relative;
width: 100%;
min-height: 58px;
Expand All @@ -17,22 +17,22 @@ const HeaderElement = styled.div`
margin-bottom: 1px;
`

const HeaderLogoElement = styled(Logo)`
export const HeaderLogoElement = styled(Logo)`
height: 34px;
user-select: none;
`

const HeaderSpacerElement = styled.div`
export const HeaderSpacerElement = styled.div`
flex-grow: 1;
`

const HeaderContextElement = styled.div`
export const HeaderContextElement = styled.div`
display: flex;
flex-direction: row;
align-items: center;
`

const HeaderUserElement = styled.span`
export const HeaderUserElement = styled.span`
font-size: 16px;
font-weight: 400;
margin-right: 18px;
Expand Down Expand Up @@ -82,12 +82,4 @@ function HeaderComponent() {
)
}

export default HeaderComponent

export {
HeaderElement,
HeaderLogoElement,
HeaderSpacerElement,
HeaderContextElement,
HeaderUserElement,
}
export default HeaderComponent
12 changes: 3 additions & 9 deletions src/components/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react"
import styled from "styled-components"
import Icon from "@mdi/react"

const IconButtonElement = styled.div.attrs({
export const IconButtonElement = styled.div.attrs({
role: "button",
})`
display: inline-block;
Expand All @@ -16,7 +16,7 @@ const IconButtonElement = styled.div.attrs({
}
`

type IconButtonOptions = {
export type IconButtonOptions = {
icon: string,
color?: string,
onClick: React.MouseEventHandler<HTMLDivElement>,
Expand All @@ -39,10 +39,4 @@ function IconButtonComponent(props: IconButtonOptions) {
)
}

export default IconButtonComponent

export {
IconButtonOptions,

IconButtonElement,
}
export default IconButtonComponent
29 changes: 9 additions & 20 deletions src/components/LoginPrompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from "styled-components"
import colors from "../presets/colors"
import Logo from "../assets/logo.svg"

type LoginProvider = {
export type LoginProvider = {
id: string,
name: string,
textColor: string,
Expand All @@ -19,7 +19,7 @@ const loginProviders = [
},
] as LoginProvider[]

const LoginProviderElement = styled.a`
export const LoginProviderElement = styled.a`
display: flex;
align-items: center;
justify-content: center;
Expand All @@ -33,7 +33,7 @@ const LoginProviderElement = styled.a`
}
`

const LoginProviderTextElement = styled.span`
export const LoginProviderTextElement = styled.span`
font-size: 16px;
font-weight: 400;
Expand Down Expand Up @@ -64,7 +64,7 @@ function LoginProviderComponent({ id, name, textColor, backgroundColor }: {
)
}

const LoginPromptContainerElement = styled.div`
export const LoginPromptContainerElement = styled.div`
display: flex;
flex-direction: column;
align-items: center;
Expand All @@ -73,12 +73,12 @@ const LoginPromptContainerElement = styled.div`
height: 100%;
`

const LoginPromptLogoElement = styled(Logo)`
export const LoginPromptLogoElement = styled(Logo)`
max-width: 200px;
margin-bottom: 20px;
`

const LoginPromptElement = styled.div`
export const LoginPromptElement = styled.div`
display: flex;
flex-direction: column;
align-items: center;
Expand All @@ -88,13 +88,13 @@ const LoginPromptElement = styled.div`
position: relative;
`

const LoginPromptHeaderElement = styled.div`
export const LoginPromptHeaderElement = styled.div`
font-size: 14px;
font-weight: 400;
color: #7F7F7F;
`

const LoginProvidersElement = styled.div`
export const LoginProvidersElement = styled.div`
display: flex;
flex-direction: column;
`
Expand All @@ -117,15 +117,4 @@ function LoginPromptComponent() {
)
}

export default LoginPromptComponent

export {
LoginProviderElement,
LoginProviderTextElement,

LoginPromptContainerElement,
LoginPromptLogoElement,
LoginPromptElement,
LoginPromptHeaderElement,
LoginProvidersElement,
}
export default LoginPromptComponent
8 changes: 2 additions & 6 deletions src/components/Page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react"
import styled from "styled-components"

const PageElement = styled.div``
export const PageElement = styled.div``

function PageComponent({ name, children, ...props }: {
name: string,
Expand All @@ -15,8 +15,4 @@ function PageComponent({ name, children, ...props }: {
)
}

export default PageComponent

export {
PageElement,
}
export default PageComponent
Loading

0 comments on commit 781a2e3

Please sign in to comment.