-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
473 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// From jr-layouts by Hoishin https://github.com/JapaneseRestream/jr-layouts | ||
// Slightly modified by Ewan Lyon | ||
|
||
import React, { useRef, useEffect } from 'react'; | ||
|
||
import styled from 'styled-components'; | ||
|
||
export const Text = styled.div` | ||
white-space: nowrap; | ||
`; | ||
|
||
interface Props { | ||
text: string; | ||
style?: React.CSSProperties; | ||
className?: string; | ||
} | ||
|
||
export const FitText: React.FunctionComponent<Props> = React.memo((props: Props) => { | ||
const containerRef = useRef<HTMLDivElement>(null); | ||
const textRef = useRef<HTMLDivElement>(null); | ||
|
||
useEffect(() => { | ||
const container = containerRef.current; | ||
const text = textRef.current; | ||
|
||
if (!container || !text) { | ||
return; | ||
} | ||
|
||
const MAX_WIDTH = container.clientWidth; | ||
const currentWidth = text.clientWidth; | ||
const scaleX = currentWidth > MAX_WIDTH ? MAX_WIDTH / currentWidth : 1; | ||
const newTransform = `scaleX(${scaleX})`; | ||
|
||
text.style.transform = newTransform; | ||
}); | ||
|
||
return ( | ||
<div | ||
className={props.className} | ||
style={{ display: 'flex', justifyContent: 'center', ...props.style }} | ||
ref={containerRef}> | ||
<Text ref={textRef}>{props.text}</Text> | ||
</div> | ||
); | ||
}); | ||
|
||
FitText.displayName = 'FitText'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { DraggableProvidedDragHandleProps } from 'react-beautiful-dnd'; | ||
|
||
const Handle = styled.div` | ||
height: 9px; | ||
width: 18px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
`; | ||
|
||
const HandleBar = styled.div` | ||
height: 2px; | ||
width: 100%; | ||
background: #525f78; | ||
border-radius: 1px; | ||
`; | ||
|
||
interface Props { | ||
handleProps: DraggableProvidedDragHandleProps | undefined; | ||
} | ||
|
||
export const GrabHandles: React.FC<Props> = (props: Props) => { | ||
return ( | ||
<Handle {...props.handleProps}> | ||
<HandleBar /> | ||
<HandleBar /> | ||
</Handle> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import styled from 'styled-components'; | ||
|
||
import { Button, Checkbox, TextField } from '@material-ui/core'; | ||
import { green, red } from '@material-ui/core/colors'; | ||
|
||
export const GreenButton = styled(Button)` | ||
&.MuiButton-contained { | ||
background: ${green[600]}; | ||
color: white; | ||
} | ||
&.MuiButton-contained:hover { | ||
background: ${green[300]}; | ||
} | ||
`; | ||
|
||
export const RedButton = styled(Button)` | ||
&.MuiButton-contained { | ||
background: ${red[600]}; | ||
color: white; | ||
} | ||
&.MuiButton-contained:hover { | ||
background: ${red[600]}; | ||
} | ||
`; | ||
|
||
export const GreenCheckbox = styled(Checkbox)` | ||
&.MuiCheckbox-colorSecondary.Mui-checked:hover { | ||
background-color: ${green[600]}0a; | ||
} | ||
&.MuiIconButton-colorSecondary:hover { | ||
background-color: ${green[600]}0a; | ||
} | ||
&.MuiCheckbox-colorSecondary.Mui-checked { | ||
color: ${green[600]}; | ||
} | ||
& svg { | ||
background-color: #ffffff; | ||
} | ||
`; | ||
|
||
export const LightTextfield = styled(TextField)` | ||
&.Mui-focused { | ||
color: #a8bde3; | ||
} | ||
&.MuiInput-underline:after { | ||
border-bottom: 2px solid #a8bde3; | ||
} | ||
&.MuiInputBase-input { | ||
color: #ffffff; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.