renamed js folder as common + moved hardcoded colors into global.js

This commit is contained in:
Sam Ludford
2019-05-22 12:33:42 +01:00
committed by Lachlan Kermode
parent c32dff1080
commit 7755a8fee2
28 changed files with 47 additions and 32 deletions

View File

@@ -1,6 +1,6 @@
import React from 'react'
import { capitalizeFirstLetter } from '../../../js/utilities.js'
import { capitalizeFirstLetter } from '../../../common/utilities.js'
const CardCategory = ({ categoryTitle, categoryLabel, color }) => (
<div className='card-row card-cell category'>

View File

@@ -1,6 +1,6 @@
import React from 'react'
import copy from '../../../js/data/copy.json'
import copy from '../../../common/data/copy.json'
const CardLocation = ({ language, location, isPrecise }) => {
if (location !== '') {

View File

@@ -1,6 +1,6 @@
import React from 'react'
import copy from '../../../js/data/copy.json'
import copy from '../../../common/data/copy.json'
const CardSummary = ({ language, description, isHighlighted }) => {
const summary = copy[language].cardstack.description

View File

@@ -1,6 +1,6 @@
import React from 'react'
import copy from '../../../js/data/copy.json'
import copy from '../../../common/data/copy.json'
const CardTags = ({ tags, language }) => {
const tagsLang = copy[language].cardstack.tags

View File

@@ -1,7 +1,7 @@
import React from 'react'
import copy from '../../../js/data/copy.json'
import { isNotNullNorUndefined } from '../../../js/utilities'
import copy from '../../../common/data/copy.json'
import { isNotNullNorUndefined } from '../../../common/utilities'
const CardTimestamp = ({ timelabel, language, precision }) => {
// const daytimeLang = copy[language].cardstack.timestamp

View File

@@ -1,5 +1,6 @@
import React from 'react'
import { Portal } from 'react-portal'
import colors from '../../../common/global.js'
function MapEvents ({ getCategoryColor, categories, projectPoint, styleLocation, selected, narrative, onSelect, svg, locations }) {
function getCoordinatesForPercent (radius, percent) {
@@ -16,7 +17,7 @@ function MapEvents ({ getCategoryColor, categories, projectPoint, styleLocation,
cx="0"
cy="0"
r="10"
stroke="#ffd800"
stroke={colors.primaryHighlight}
fill-opacity="0.0"
/>}
</React.Fragment>
@@ -30,7 +31,7 @@ function MapEvents ({ getCategoryColor, categories, projectPoint, styleLocation,
let styles = ({
fill: getCategoryColor(locCategory),
stroke: '#ffffff',
stroke: colors.darkBackground,
strokeWidth: 0,
fillOpacity: 0.85,
...extraStyles

View File

@@ -1,5 +1,6 @@
import React from 'react'
import { Portal } from 'react-portal'
import colors from '../../../common/global.js'
class MapSelectedEvents extends React.Component {
renderMarker (event) {
@@ -13,7 +14,7 @@ class MapSelectedEvents extends React.Component {
>
<path
className='leaflet-interactive'
stroke={styles ? styles.stroke : '#ffd800'}
stroke={styles ? styles.stroke : colors.primaryHighlight}
stroke-opacity='1'
stroke-width={styles ? styles['stroke-width'] : 2}
stroke-linecap=''

View File

@@ -1,4 +1,5 @@
import React from 'react'
import colors from '../../../common/global.js'
const TimelineMarkers = ({ styles, getEventX, getCategoryY, transitionDuration, selected }) => {
function renderMarker (event) {
@@ -7,7 +8,7 @@ const TimelineMarkers = ({ styles, getEventX, getCategoryY, transitionDuration,
className='timeline-marker'
cx={0}
cy={0}
stroke={styles ? styles.stroke : '#ffffff'}
stroke={styles ? styles.stroke : colors.secondaryHighlight}
stroke-opacity='1'
stroke-width={styles ? styles['stroke-width'] : 2}
stroke-linecap=''