Move common components to nested directory

This commit is contained in:
Tom Russell 2019-08-14 08:45:00 +01:00
parent fefdab7ab4
commit b0bfe70e9d
25 changed files with 28 additions and 79 deletions

View File

@ -2,11 +2,11 @@ import React, { Component, Fragment } from 'react';
import { Link, NavLink, Redirect } from 'react-router-dom';
import PropTypes from 'prop-types';
import ErrorBox from './error-box';
import InfoBox from './info-box';
import ErrorBox from './components/error-box';
import InfoBox from './components/info-box';
import Sidebar from './sidebar';
import Tooltip from './tooltip';
import { SaveIcon } from './icons';
import Tooltip from './components/tooltip';
import { SaveIcon } from './components/icons';
import CONFIG from './fields-config.json';

View File

@ -3,9 +3,9 @@ import { Link, NavLink } from 'react-router-dom';
import PropTypes from 'prop-types';
import Sidebar from './sidebar';
import Tooltip from './tooltip';
import InfoBox from './info-box';
import { EditIcon } from './icons';
import Tooltip from './components/tooltip';
import InfoBox from './components/info-box';
import { EditIcon } from './components/icons';
import { sanitiseURL } from './helpers';
import CONFIG from './fields-config.json';

View File

@ -8,7 +8,7 @@ class Tooltip extends Component<any, any> { // TODO: add proper types
static propTypes = { // TODO: generate propTypes from TS
text: PropTypes.string
};
constructor(props) {
super(props);
this.state = {

View File

@ -2,7 +2,7 @@ import React, { Fragment } from 'react';
import { NavLink } from 'react-router-dom';
import PropTypes from 'prop-types';
import Logo from './logo';
import Logo from './components/logo';
import './header.css';
/**
@ -14,7 +14,7 @@ class Header extends React.Component<any, any> { // TODO: add proper types
username: PropTypes.string
})
};
constructor(props) {
super(props);
this.state = {collapseMenu: true};

View File

@ -2,16 +2,16 @@ import React, { Component } from 'react';
import { Redirect, Link } from 'react-router-dom';
import PropTypes from 'prop-types';
import ErrorBox from './error-box';
import InfoBox from './info-box';
import SupporterLogos from './supporter-logos';
import ErrorBox from './components/error-box';
import InfoBox from './components/info-box';
import SupporterLogos from './components/supporter-logos';
class Login extends Component<any, any> { // TODO: add proper types
static propTypes = { // TODO: generate propTypes from TS
login: PropTypes.func,
user: PropTypes.object
};
constructor(props) {
super(props);
this.state = {

View File

@ -5,7 +5,7 @@ import { Map, TileLayer, ZoomControl, AttributionControl } from 'react-leaflet-u
import '../../node_modules/leaflet/dist/leaflet.css'
import './map.css'
import { HelpIcon } from './icons';
import { HelpIcon } from './components/icons';
import Legend from './legend';
import { parseCategoryURL } from '../parse';
import SearchBox from './search-box';
@ -25,7 +25,7 @@ class ColouringMap extends Component<any, any> { // TODO: add proper types
match: PropTypes.object,
history: PropTypes.object
};
constructor(props) {
super(props);
this.state = {

View File

@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
import Sidebar from './sidebar';
import CONFIG from './fields-config.json';
import InfoBox from './info-box';
import InfoBox from './components/info-box';
import { sanitiseURL } from './helpers';
const MultiEdit = (props) => {

View File

@ -3,7 +3,7 @@ import { NavLink, Redirect } from 'react-router-dom';
import PropTypes from 'prop-types';
import Sidebar from './sidebar';
import { EditIcon } from './icons';
import { EditIcon } from './components/icons';
import CONFIG from './fields-config.json';
const Overview = (props) => {

View File

@ -1,6 +1,6 @@
import React from 'react';
import SupporterLogos from '../supporter-logos';
import SupporterLogos from '../components/supporter-logos';
import './about.css';
const AboutPage = () => (

View File

@ -1,7 +1,7 @@
import React from 'react';
import { Link } from 'react-router-dom';
import InfoBox from '../info-box';
import InfoBox from '../components/info-box';
const ContributorAgreementPage : React.SFC<any> = () => (
<article>

View File

@ -3,7 +3,7 @@ import { Link, Redirect } from 'react-router-dom';
import PropTypes from 'prop-types';
import ConfirmationModal from '../confirmation-modal';
import ErrorBox from '../error-box';
import ErrorBox from '../components/error-box';
class MyAccountPage extends Component<any, any> { // TODO: add proper types
static propTypes = { // TODO: generate propTypes from TS

View File

@ -1,7 +1,7 @@
import React from 'react';
import { Link } from 'react-router-dom';
import InfoBox from '../info-box';
import InfoBox from '../components/info-box';
const PrivacyPolicyPage: React.SFC<any> = () => (
<article>

View File

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './search-box.css';
import { SearchIcon } from './icons';
import { SearchIcon } from './components/icons';
/**
* Search for location
*/
@ -11,7 +11,7 @@ class SearchBox extends Component<any, any> { // TODO: add proper types
onLocate: PropTypes.func,
isBuilding: PropTypes.bool
};
constructor(props) {
super(props);
this.state = {

View File

@ -3,7 +3,7 @@ import { Link } from 'react-router-dom';
import PropTypes from 'prop-types';
import './sidebar.css';
import { BackIcon } from './icons';
import { BackIcon } from './components/icons';
const Sidebar = (props) => (
<div id="legend" className="info-container">

View File

@ -2,9 +2,9 @@ import React, { Component } from 'react';
import { Redirect, Link } from 'react-router-dom';
import PropTypes from 'prop-types';
import ErrorBox from './error-box';
import InfoBox from './info-box';
import SupporterLogos from './supporter-logos';
import ErrorBox from './components/error-box';
import InfoBox from './components/info-box';
import SupporterLogos from './components/supporter-logos';
class SignUp extends Component<any, any> { // TODO: add proper types
static propTypes = { // TODO: generate propTypes from TS

View File

@ -1,23 +0,0 @@
/**
* Welcome jumbotron
*/
.welcome-float {
position: absolute;
z-index: 10000;
top: 0;
width: 100%;
border-radius: 0;
padding: 1.5em 2.5em 2.5em;
}
.welcome-float.jumbotron {
background: #fff;
background-color: rgba(255,255,255,0.95);
}
@media (min-width: 768px){
.welcome-float {
left: 50%;
margin-left: -22.5em;
width: 45em;
top: 1em;
}
}

View File

@ -1,28 +0,0 @@
import React from 'react';
import { Link } from 'react-router-dom';
import './welcome.css';
const Welcome = () => (
<div className="jumbotron welcome-float">
<h1 className="h1">Welcome to Colouring London</h1>
<p className="lead">
Colouring London is a citizen science platform collecting information on every
building in London, to help make the city more sustainable. We&rsquo;re building it at The
Bartlett Centre for Advanced Spatial Analysis, University College London.
</p>
<p className="lead">
Can you help us? We&rsquo;re still at an early stage of development, and we&rsquo;re looking for
volunteers of all ages and abilities to test and provide feedback on the site as we
build it.
</p>
<Link to="/view/age.html"
className="btn btn-outline-dark btn-lg btn-block">
Start Colouring Here!
</Link>
<img src="images/supporter-logos.png" alt="Colouring London collaborating organisations: The Bartlett UCL, Ordnance Survey, Historic England, Greater London Authority" />
</div>
);
export default Welcome;