Move common components to nested directory
This commit is contained in:
parent
fefdab7ab4
commit
b0bfe70e9d
@ -2,11 +2,11 @@ import React, { Component, Fragment } from 'react';
|
|||||||
import { Link, NavLink, Redirect } from 'react-router-dom';
|
import { Link, NavLink, Redirect } from 'react-router-dom';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import ErrorBox from './error-box';
|
import ErrorBox from './components/error-box';
|
||||||
import InfoBox from './info-box';
|
import InfoBox from './components/info-box';
|
||||||
import Sidebar from './sidebar';
|
import Sidebar from './sidebar';
|
||||||
import Tooltip from './tooltip';
|
import Tooltip from './components/tooltip';
|
||||||
import { SaveIcon } from './icons';
|
import { SaveIcon } from './components/icons';
|
||||||
|
|
||||||
import CONFIG from './fields-config.json';
|
import CONFIG from './fields-config.json';
|
||||||
|
|
||||||
|
@ -3,9 +3,9 @@ import { Link, NavLink } from 'react-router-dom';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import Sidebar from './sidebar';
|
import Sidebar from './sidebar';
|
||||||
import Tooltip from './tooltip';
|
import Tooltip from './components/tooltip';
|
||||||
import InfoBox from './info-box';
|
import InfoBox from './components/info-box';
|
||||||
import { EditIcon } from './icons';
|
import { EditIcon } from './components/icons';
|
||||||
import { sanitiseURL } from './helpers';
|
import { sanitiseURL } from './helpers';
|
||||||
|
|
||||||
import CONFIG from './fields-config.json';
|
import CONFIG from './fields-config.json';
|
||||||
|
@ -8,7 +8,7 @@ class Tooltip extends Component<any, any> { // TODO: add proper types
|
|||||||
static propTypes = { // TODO: generate propTypes from TS
|
static propTypes = { // TODO: generate propTypes from TS
|
||||||
text: PropTypes.string
|
text: PropTypes.string
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
@ -2,7 +2,7 @@ import React, { Fragment } from 'react';
|
|||||||
import { NavLink } from 'react-router-dom';
|
import { NavLink } from 'react-router-dom';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import Logo from './logo';
|
import Logo from './components/logo';
|
||||||
import './header.css';
|
import './header.css';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -14,7 +14,7 @@ class Header extends React.Component<any, any> { // TODO: add proper types
|
|||||||
username: PropTypes.string
|
username: PropTypes.string
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {collapseMenu: true};
|
this.state = {collapseMenu: true};
|
||||||
|
@ -2,16 +2,16 @@ import React, { Component } from 'react';
|
|||||||
import { Redirect, Link } from 'react-router-dom';
|
import { Redirect, Link } from 'react-router-dom';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import ErrorBox from './error-box';
|
import ErrorBox from './components/error-box';
|
||||||
import InfoBox from './info-box';
|
import InfoBox from './components/info-box';
|
||||||
import SupporterLogos from './supporter-logos';
|
import SupporterLogos from './components/supporter-logos';
|
||||||
|
|
||||||
class Login extends Component<any, any> { // TODO: add proper types
|
class Login extends Component<any, any> { // TODO: add proper types
|
||||||
static propTypes = { // TODO: generate propTypes from TS
|
static propTypes = { // TODO: generate propTypes from TS
|
||||||
login: PropTypes.func,
|
login: PropTypes.func,
|
||||||
user: PropTypes.object
|
user: PropTypes.object
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
|
@ -5,7 +5,7 @@ import { Map, TileLayer, ZoomControl, AttributionControl } from 'react-leaflet-u
|
|||||||
import '../../node_modules/leaflet/dist/leaflet.css'
|
import '../../node_modules/leaflet/dist/leaflet.css'
|
||||||
import './map.css'
|
import './map.css'
|
||||||
|
|
||||||
import { HelpIcon } from './icons';
|
import { HelpIcon } from './components/icons';
|
||||||
import Legend from './legend';
|
import Legend from './legend';
|
||||||
import { parseCategoryURL } from '../parse';
|
import { parseCategoryURL } from '../parse';
|
||||||
import SearchBox from './search-box';
|
import SearchBox from './search-box';
|
||||||
@ -25,7 +25,7 @@ class ColouringMap extends Component<any, any> { // TODO: add proper types
|
|||||||
match: PropTypes.object,
|
match: PropTypes.object,
|
||||||
history: PropTypes.object
|
history: PropTypes.object
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
|
@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
|
|||||||
|
|
||||||
import Sidebar from './sidebar';
|
import Sidebar from './sidebar';
|
||||||
import CONFIG from './fields-config.json';
|
import CONFIG from './fields-config.json';
|
||||||
import InfoBox from './info-box';
|
import InfoBox from './components/info-box';
|
||||||
import { sanitiseURL } from './helpers';
|
import { sanitiseURL } from './helpers';
|
||||||
|
|
||||||
const MultiEdit = (props) => {
|
const MultiEdit = (props) => {
|
||||||
|
@ -3,7 +3,7 @@ import { NavLink, Redirect } from 'react-router-dom';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import Sidebar from './sidebar';
|
import Sidebar from './sidebar';
|
||||||
import { EditIcon } from './icons';
|
import { EditIcon } from './components/icons';
|
||||||
import CONFIG from './fields-config.json';
|
import CONFIG from './fields-config.json';
|
||||||
|
|
||||||
const Overview = (props) => {
|
const Overview = (props) => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import SupporterLogos from '../supporter-logos';
|
import SupporterLogos from '../components/supporter-logos';
|
||||||
import './about.css';
|
import './about.css';
|
||||||
|
|
||||||
const AboutPage = () => (
|
const AboutPage = () => (
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
import InfoBox from '../info-box';
|
import InfoBox from '../components/info-box';
|
||||||
|
|
||||||
const ContributorAgreementPage : React.SFC<any> = () => (
|
const ContributorAgreementPage : React.SFC<any> = () => (
|
||||||
<article>
|
<article>
|
||||||
|
@ -3,7 +3,7 @@ import { Link, Redirect } from 'react-router-dom';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import ConfirmationModal from '../confirmation-modal';
|
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
|
class MyAccountPage extends Component<any, any> { // TODO: add proper types
|
||||||
static propTypes = { // TODO: generate propTypes from TS
|
static propTypes = { // TODO: generate propTypes from TS
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
import InfoBox from '../info-box';
|
import InfoBox from '../components/info-box';
|
||||||
|
|
||||||
const PrivacyPolicyPage: React.SFC<any> = () => (
|
const PrivacyPolicyPage: React.SFC<any> = () => (
|
||||||
<article>
|
<article>
|
||||||
|
@ -2,7 +2,7 @@ import React, { Component } from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import './search-box.css';
|
import './search-box.css';
|
||||||
import { SearchIcon } from './icons';
|
import { SearchIcon } from './components/icons';
|
||||||
/**
|
/**
|
||||||
* Search for location
|
* Search for location
|
||||||
*/
|
*/
|
||||||
@ -11,7 +11,7 @@ class SearchBox extends Component<any, any> { // TODO: add proper types
|
|||||||
onLocate: PropTypes.func,
|
onLocate: PropTypes.func,
|
||||||
isBuilding: PropTypes.bool
|
isBuilding: PropTypes.bool
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
|
@ -3,7 +3,7 @@ import { Link } from 'react-router-dom';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import './sidebar.css';
|
import './sidebar.css';
|
||||||
import { BackIcon } from './icons';
|
import { BackIcon } from './components/icons';
|
||||||
|
|
||||||
const Sidebar = (props) => (
|
const Sidebar = (props) => (
|
||||||
<div id="legend" className="info-container">
|
<div id="legend" className="info-container">
|
||||||
|
@ -2,9 +2,9 @@ import React, { Component } from 'react';
|
|||||||
import { Redirect, Link } from 'react-router-dom';
|
import { Redirect, Link } from 'react-router-dom';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import ErrorBox from './error-box';
|
import ErrorBox from './components/error-box';
|
||||||
import InfoBox from './info-box';
|
import InfoBox from './components/info-box';
|
||||||
import SupporterLogos from './supporter-logos';
|
import SupporterLogos from './components/supporter-logos';
|
||||||
|
|
||||||
class SignUp extends Component<any, any> { // TODO: add proper types
|
class SignUp extends Component<any, any> { // TODO: add proper types
|
||||||
static propTypes = { // TODO: generate propTypes from TS
|
static propTypes = { // TODO: generate propTypes from TS
|
||||||
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -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’re building it at The
|
|
||||||
Bartlett Centre for Advanced Spatial Analysis, University College London.
|
|
||||||
</p>
|
|
||||||
<p className="lead">
|
|
||||||
Can you help us? We’re still at an early stage of development, and we’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;
|
|
Loading…
Reference in New Issue
Block a user