move blue/red colors into constants

main
Mike Fix 5 years ago
parent da8afe5f90
commit 420f1333c0

@ -1,9 +1,11 @@
import React from 'react' import React from 'react'
import { useAsyncCallback, useOnline } from '@dawnlabs/tacklebox' import { useAsyncCallback, useOnline } from '@dawnlabs/tacklebox'
import Button from './Button'
import { useAuth } from './AuthContext' import Button from './Button'
import Toolbar from './Toolbar' import Toolbar from './Toolbar'
import { useAuth } from './AuthContext'
import { COLORS } from '../lib/constants'
function ConfirmButton(props) { function ConfirmButton(props) {
const [confirmed, setConfirmed] = React.useState(false) const [confirmed, setConfirmed] = React.useState(false)
@ -39,7 +41,7 @@ function DeleteButton(props) {
large large
color="#fff" color="#fff"
onClick={onClick} onClick={onClick}
style={{ color: '#ff5f56' }} style={{ color: COLORS.RED }}
> >
{loading ? 'Deleting...' : 'Delete'} {loading ? 'Deleting...' : 'Delete'}
</ConfirmButton> </ConfirmButton>

@ -4,6 +4,8 @@ import { useAsyncCallback, useOnline as useOnlineListener } from '@dawnlabs/tack
import { useAPI } from './ApiContext' import { useAPI } from './ApiContext'
import Button from './Button' import Button from './Button'
import { COLORS } from '../lib/constants'
function TweetButton(props) { function TweetButton(props) {
const api = useAPI() const api = useAPI()
const online = useOnlineListener() const online = useOnlineListener()
@ -25,7 +27,7 @@ function TweetButton(props) {
padding="0 16px" padding="0 16px"
margin="0 8px 0 0" margin="0 8px 0 0"
onClick={onClick} onClick={onClick}
color="#57b5f9" color={COLORS.BLUE}
> >
{loading ? 'Loading...' : 'Tweet'} {loading ? 'Loading...' : 'Tweet'}
</Button> </Button>

@ -73,7 +73,7 @@ const unsplash = {
} }
} }
function getSnippet(uid, { host } = {}) { function getSnippet(uid = '', { host } = {}) {
return client return client
.get(`/snippets/${uid}`, host ? { baseURL: `https://${host}/api` } : undefined) .get(`/snippets/${uid}`, host ? { baseURL: `https://${host}/api` } : undefined)
.then(res => res.data) .then(res => res.data)

@ -1013,7 +1013,8 @@ export const COLORS = {
HOVER: '#1F1F1F', HOVER: '#1F1F1F',
PURPLE: '#C198FB', PURPLE: '#C198FB',
DARK_PURPLE: '#55436F', DARK_PURPLE: '#55436F',
RED: 'red' RED: '#ff5f56',
BLUE: '#57b5f9'
} }
export const DEFAULT_CODE = `const pluckDeep = key => obj => key.split('.').reduce((accum, key) => accum[key], obj) export const DEFAULT_CODE = `const pluckDeep = key => obj => key.split('.').reduce((accum, key) => accum[key], obj)

Loading…
Cancel
Save