Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ services:
healthcheck:
test: ['CMD', '/bin/sh', '/home/node/app/scripts/server_healthy.sh']
interval: 1s
retries: 30
retries: 60
tty: true
init: true

Expand Down
8 changes: 2 additions & 6 deletions packages/client/app/DefaultPage.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import Modal from 'react-modal'
import { ThemeProvider } from 'styled-components'

import theme from './theme'
import GlobalStyle from './theme/elements/GlobalStyle'

import AssetManager from './components/asset-manager/src/AssetManagerPage'
Expand All @@ -23,10 +21,8 @@ const DefaultPage = () => {
<XpubProvider>
<JournalProvider journal={JSON.parse(JSON.stringify(journal))}>
<ModalProvider modals={modals}>
<ThemeProvider theme={theme}>
<GlobalStyle />
<Router />
</ThemeProvider>
<GlobalStyle />
<Router />
</ModalProvider>
</JournalProvider>
</XpubProvider>
Expand Down
11 changes: 5 additions & 6 deletions packages/client/app/components/NextPageButton/style.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Link } from 'react-router-dom'
import styled from 'styled-components'
import { th } from '@coko/client'
import { color } from '../../theme'

export const HasNextPage = styled(Link)`
align-items: center;
Expand All @@ -13,9 +12,9 @@ export const HasNextPage = styled(Link)`
`

export const NextPageButton = styled.span`
border-bottom: 1px solid ${color.brand1.tint90};
border-top: 1px solid ${color.brand1.tint90};
color: ${color.brand1.base};
border-bottom: 1px solid ${th('color.brand1.tint90')};
border-top: 1px solid ${th('color.brand1.tint90')};
color: ${th('color.brand1.base')};
display: flex;
flex: 1;
font-size: 15px;
Expand All @@ -28,8 +27,8 @@ export const NextPageButton = styled.span`
width: 100%;

&:hover {
background: ${color.brand1.tint50};
color: ${color.brand1.base};
background: ${th('color.brand1.tint50')};
color: ${th('color.brand1.base')};
cursor: pointer;
}
`
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

import styled from 'styled-components'
import { th, darken } from '@coko/client'
import { color } from '../../../../theme'

const Button = styled.button`
align-items: center;
background: ${({ type }) => {
background: ${({ theme, type }) => {
if (type === 'primary') {
return color.brand1.base
return theme.color.brand1.base
}

if (type === 'delete') {
Expand All @@ -35,13 +34,13 @@ const Button = styled.button`
}

&:not(:disabled):hover {
background: ${({ type }) => {
background: ${({ theme, type }) => {
if (type === 'primary') {
return color.brand1.tint25
return theme.color.brand1.tint25
}

if (type === 'delete') {
return th('colorError')
return theme.colorError
}

return 'none'
Expand Down
19 changes: 8 additions & 11 deletions packages/client/app/components/asset-manager/src/ui/Button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,33 @@

import styled from 'styled-components'
import { th } from '@coko/client'
import { color } from '../../../../theme'

const Button = styled.button`
/* stylelint-disable declaration-no-important */
align-items: center;
background: none;
border: none;
color: ${color.gray50};
color: ${th('color.gray50')};
display: flex;
font-family: 'Fira Sans Condensed', sans-serif !important;
padding: 0;
/* padding: calc(${th('gridUnit')} / 2); */
svg {
svg {
path {
fill: ${color.gray50};
fill: ${th('color.gray50')};
}
}
height: 28px;
width: 28px;
}

&:disabled {
color: ${color.gray90};
color: ${th('color.gray90')};

svg {
path {
fill: ${color.gray90};
fill: ${th('color.gray90')};
}
}

Expand All @@ -45,25 +44,23 @@ const Button = styled.button`
}

&:not(:disabled):hover {
/* background-color: ${color.backgroundC}; */
color: ${color.brand1.base};
color: ${th('color.brand1.base')};

svg {
path {
fill: ${color.brand1.base};
fill: ${th('color.brand1.base')};
}
}
}

&:not(:disabled):active {
/* background-color: ${color.gray90}; */
border: none;
color: ${color.brand1.base};
color: ${th('color.brand1.base')};
outline: none;

svg {
path {
fill: ${color.brand1.base};
fill: ${th('color.brand1.base')};
}
}
}
Expand Down
45 changes: 26 additions & 19 deletions packages/client/app/components/asset-manager/src/ui/FilesTable.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
/* eslint-disable react/prop-types */

import styled from 'styled-components'
import styled, { useTheme } from 'styled-components'
import { th } from '@coko/client'
import { indexOf } from 'lodash'

import { dateTimeFormatter, fileSizeFormatter } from './helpers'
import IconButton from './IconButton'
import { Loading } from './Modal'
import { color } from '../../../../theme'

const TableWrapper = styled.div`
align-items: center;
Expand All @@ -28,7 +27,7 @@ const TableHead = styled.div`

const TableHeadCell = styled.div`
align-items: center;
background: ${color.gray90};
background: ${th('color.gray90')};
display: flex;
flex-basis: ${({ width }) => (width ? `${width}%` : '33.33%')};
padding: 8px;
Expand Down Expand Up @@ -61,19 +60,21 @@ const TableBodyEmpty = styled.div`

const TableRow = styled.div`
align-items: center;
background: ${({ selected }) => (selected ? color.brand1.base : 'inherit')};
color: ${({ selected }) => (selected ? color.textReverse : 'inherit')};
background: ${({ selected, theme }) =>
selected ? theme.color.brand1.base : 'inherit'};
color: ${({ selected, theme }) =>
selected ? theme.color.textReverse : 'inherit'};
display: flex;
user-select: none;
width: 100%;

&:nth-child(even) {
background: ${({ selected }) =>
selected ? color.brand1.base : color.backgroundC};
background: ${({ selected, theme }) =>
selected ? theme.color.brand1.base : theme.color.backgroundC};
}

&:hover {
background: ${color.brand1.base};
background: ${th('color.brand1.base')};
color: white;
}
`
Expand All @@ -94,17 +95,23 @@ const TableCell = styled.div`
text-align: left;
`

const ascIcon = (
<svg fill={color.text} viewBox="0 0 24 24">
<path d="M19 17H22L18 21L14 17H17V3H19M2 17H12V19H2M6 5V7H2V5M2 11H9V13H2V11Z" />
</svg>
)
const AscIcon = () => {
const theme = useTheme()
return (
<svg fill={theme.color.text} viewBox="0 0 24 24">
<path d="M19 17H22L18 21L14 17H17V3H19M2 17H12V19H2M6 5V7H2V5M2 11H9V13H2V11Z" />
</svg>
)
}

const descIcon = (
<svg fill={color.text} viewBox="0 0 24 24">
<path d="M19 7H22L18 3L14 7H17V21H19M2 17H12V19H2M6 5V7H2V5M2 11H9V13H2V11Z" />
</svg>
)
const DescIcon = () => {
const theme = useTheme()
return (
<svg fill={theme.color.text} viewBox="0 0 24 24">
<path d="M19 7H22L18 3L14 7H17V21H19M2 17H12V19H2M6 5V7H2V5M2 11H9V13H2V11Z" />
</svg>
)
}

const FilesTable = ({
checkboxColumn,
Expand Down Expand Up @@ -224,7 +231,7 @@ const FilesTable = ({
<TableHeadCell key={label} width={width}>
{sortable && (
<IconButton
icon={sortingState[label] ? ascIcon : descIcon}
icon={sortingState[label] ? <AscIcon /> : <DescIcon />}
onClick={() => {
sortingHandler(label)
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable react/prop-types */

import styled from 'styled-components'
import { color } from '../../../../theme'
import { th } from '@coko/client'

const Button = styled.button`
align-items: center;
Expand All @@ -26,13 +26,13 @@ const Button = styled.button`

&:disabled {
svg {
fill: ${color.gray90};
fill: ${th('color.gray90')};
}
}

&:not(:disabled):hover {
svg {
fill: ${color.brand1.base};
fill: ${th('color.brand1.base')};
}
}
`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import styled from 'styled-components'
import { th } from '@coko/client'

import { Button, Icons } from './Modal'
import { color } from '../../../../theme'

const { saveIcon, editIcon, exitIcon } = Icons

Expand All @@ -22,7 +21,7 @@ const Input = styled.input`
width: 78.2%;

&:focus {
border-bottom: 1px dashed ${color.brand1.base};
border-bottom: 1px dashed ${th('color.brand1.base')};
outline: 0;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import styled from 'styled-components'
import { th } from '@coko/client'
import { color } from '../../../../theme'

const StyledSpinner = styled.svg`
animation: rotate 1s linear infinite;
Expand All @@ -10,7 +9,7 @@ const StyledSpinner = styled.svg`

& .path {
animation: dash 1.5s ease-in-out infinite;
stroke: ${color.brand1.base};
stroke: ${th('color.brand1.base')};
stroke-linecap: round;
}

Expand Down Expand Up @@ -48,7 +47,7 @@ const Wrapper = styled.div`
`

const Label = styled.div`
color: ${color.brand1.base};
color: ${th('color.brand1.base')};
font-family: ${th('fontHeading')};
font-size: ${th('fontSizeBase')};
line-height: ${th('lineHeightBase')};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* stylelint-disable string-quotes */

import styled from 'styled-components'
import { rotate360 } from '@coko/client'
import { color } from '../../../../../theme'
import { rotate360, th } from '@coko/client'

const Wrapper = styled.div`
align-items: center;
Expand All @@ -20,9 +19,9 @@ const SpinnerAnimation = styled.div`

&::after {
animation: ${rotate360} 1s linear infinite;
border: 5px solid ${color.brand1.base};
border-color: ${color.brand1.base} transparent ${color.brand1.base}
transparent;
border: 5px solid ${th('color.brand1.base')};
border-color: ${th('color.brand1.base')} transparent
${th('color.brand1.base')} transparent;
border-radius: 50%;
content: ' ';
display: block;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import styled, { css } from 'styled-components'
import { th, grid } from '@coko/client'
import { color } from '../../../../../theme'

const activeStyles = css`
color: ${({ danger }) => (danger ? th('colorError') : color.brand1.base)};
color: ${({ danger, theme }) =>
danger ? theme.colorError : theme.color.brand1.base};

> i svg {
fill: ${({ danger }) => (danger ? th('colorError') : color.brand1.base)};
fill: ${({ danger, theme }) =>
danger ? theme.colorError : theme.color.brand1.base};
}
`

Expand Down Expand Up @@ -43,10 +44,12 @@ const RootButton = styled.button.attrs(({ title, type }) => ({

&:hover {
background: ${th('colorBackgroundHue')};
color: ${({ danger }) => (danger ? th('colorError') : color.brand1.base)};
color: ${({ danger, theme }) =>
danger ? theme.colorError : theme.color.brand1.base};

> i svg {
fill: ${({ danger }) => (danger ? th('colorError') : color.brand1.base)};
fill: ${({ danger, theme }) =>
danger ? theme.colorError : theme.color.brand1.base};
transition: all 0.1s ease-in;
}
}
Expand Down
Loading