Skip to content

Commit

Permalink
Init Linguist Aid
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriceyap committed Mar 25, 2020
1 parent c315a0f commit 3125435
Show file tree
Hide file tree
Showing 25 changed files with 1,582 additions and 191 deletions.
49 changes: 11 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,17 @@
This project was bootstrapped with [Create React App](/~https://github.com/facebook/create-react-app).
# Linguist Aid

## Available Scripts
We're helping to connect multi-lingual volunteers to mutual aid groups around the UK to provide free help with:

In the project directory, you can run:
- translating leaflets, flyers and posters,
- interpreting for vulnerable people,
- chatting to people on the phone who feel alone and speak little or no English.

### `yarn start`
## Developing

Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
This site is build using create-react-app and [Ant Design](https://ant.design/docs/react/introduce). To run the development server, run:

The page will reload if you make edits.<br />
You will also see any lint errors in the console.
```
$ yarn start
```

### `yarn test`

Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `yarn build`

Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `yarn eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).
Linting is done using Prettier.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
"@types/node": "^12.0.0",
"@types/react": "^16.9.0",
"@types/react-dom": "^16.9.0",
"@types/react-router-dom": "^5.1.3",
"antd": "^4.0.4",
"node-sass": "^4.13.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router-dom": "^5.1.2",
"react-scripts": "3.4.1",
"typescript": "~3.7.2"
},
Expand Down
Binary file modified public/favicon.ico
Binary file not shown.
27 changes: 2 additions & 25 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,14 @@
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
content="Linguist Aid connects volunteer translators and interpreters to mutual aid groups around the UK."
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Linguist Aid</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Binary file modified public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "Linguist Aid",
"name": "Linguist Aid",
"icons": [
{
"src": "favicon.ico",
Expand All @@ -22,4 +22,4 @@
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
}
38 changes: 0 additions & 38 deletions src/App.css

This file was deleted.

9 changes: 0 additions & 9 deletions src/App.test.tsx

This file was deleted.

26 changes: 0 additions & 26 deletions src/App.tsx

This file was deleted.

30 changes: 30 additions & 0 deletions src/LinguistAid.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@import "~antd/dist/antd.css";

#header {
position: fixed;
z-index: 1;
width: 100%;
}

#content-container {
margin: 96px auto 32px;
min-height: calc(100vh - 64px);
width: 100%;

@media (min-width: 576px) {
width: 95%;
}
@media (min-width: 768px) {
width: 90%;
}
@media (min-width: 992px) {
width: 85%;
}
@media (min-width: 1200px) {
width: 80%;
}
}

#footer {
background: #bbb;
}
59 changes: 59 additions & 0 deletions src/LinguistAid.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { Layout } from "antd";
import React, { FunctionComponent } from "react";
import { BrowserRouter as Router, Switch, Route, Link } from "react-router-dom";

import Logo from "./components/Logo";
import ScrollToTop from "./components/ScrollToTop";
import Home from "./pages/Home";
import RequestHelp from "./pages/RequestHelp";
import SignUp from "./pages/SignUp";

import "./LinguistAid.scss";
import NavBarMenu from "./components/NavBarMenu";
import About from "./pages/About";

const { Header, Footer, Content } = Layout;

const LinguistAid: FunctionComponent<{}> = () => (
<Router>
<div>
<ScrollToTop />
<Layout>
<Header id="header">
<Link to="/">
<Logo />
</Link>
<NavBarMenu />
</Header>
<Content id="content-container">
<Switch>
<Route path="/" exact>
<Home />
</Route>
<Route path="/sign-up" exact>
<SignUp />
</Route>
<Route path="/request-help" exact>
<RequestHelp />
</Route>
<Route path="/about" exact>
<About />
</Route>
</Switch>
</Content>
<Footer id="footer">
Made and run with{" "}
<span role="img" aria-label="love">
❤️
</span>{" "}
by volunteers. <Link to="/about">Get in touch with us here.</Link>{" "}
Also, a massive thank you to{" "}
<a href="https://www.netlify.com">Netlify</a> for generously hosting
and powering this site for free!
</Footer>
</Layout>
</div>
</Router>
);

export default LinguistAid;
9 changes: 9 additions & 0 deletions src/components/Logo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React, { FunctionComponent } from "react";

import "./logo.css";

const Logo: FunctionComponent<{}> = () => (
<div className="logo">Linguist Aid</div>
);

export default Logo;
34 changes: 34 additions & 0 deletions src/components/NavBarMenu.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Menu } from "antd";
import React, { FunctionComponent } from "react";
import { Link, RouteComponentProps, withRouter } from "react-router-dom";

interface IMenuItem {
route: string;
displayText: string;
}
const menuItems: IMenuItem[] = [
{
route: "/sign-up",
displayText: "I want to volunteer!"
},
{
route: "/request-help",
displayText: "We need help!"
}
];

interface INavBarMenuProps extends RouteComponentProps {}

const NavBarMenu: FunctionComponent<INavBarMenuProps> = ({
location: { pathname }
}) => (
<Menu mode="horizontal" theme="dark" selectedKeys={[pathname]}>
{menuItems.map(({ route, displayText }) => (
<Menu.Item key={route}>
<Link to={route}>{displayText}</Link>
</Menu.Item>
))}
</Menu>
);

export default withRouter(NavBarMenu);
19 changes: 19 additions & 0 deletions src/components/ScrollToTop.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { FunctionComponent, useEffect } from "react";
import { RouteComponentProps, withRouter } from "react-router-dom";

interface IScrollToTopProps extends RouteComponentProps {}

const ScrollToTop: FunctionComponent<IScrollToTopProps> = ({ history }) => {
useEffect(() => {
const unlisten = history.listen(() => {
window.scrollTo(0, 0);
});
return () => {
unlisten();
};
});

return null;
};

export default withRouter(ScrollToTop);
7 changes: 7 additions & 0 deletions src/components/logo.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.logo {
color: white;
float: left;
font-weight: 700;
font-size: 28px;
padding: 0 50px 0 0;
}
17 changes: 7 additions & 10 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import LinguistAid from "./LinguistAid";
import * as serviceWorker from "./serviceWorker";

ReactDOM.render(
<React.StrictMode>
<App />
<LinguistAid />
</React.StrictMode>,
document.getElementById('root')
document.getElementById("root")
);

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
7 changes: 0 additions & 7 deletions src/logo.svg

This file was deleted.

Loading

0 comments on commit 3125435

Please sign in to comment.