Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
7 changes: 7 additions & 0 deletions .idea/dictionaries/makali.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/we-connect.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

726 changes: 726 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

2,447 changes: 2,447 additions & 0 deletions README.md

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "we-connect",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"react-scripts": "1.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Binary file added public/favicon.ico
Binary file not shown.
47 changes: 47 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<link rel="stylesheet" href="https://unpkg.com/bootstrap-material-design@4.1.0/dist/css/bootstrap-material-design.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/open-iconic/1.1.1/font/css/open-iconic-bootstrap.min.css">

<!--
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>
</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`.
-->

<!--<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"/>-->
<!--<script src="https://unpkg.com/popper.js@1.12.6/dist/umd/popper.js"/>-->
<!--<script src="https://unpkg.com/bootstrap-material-design@4.1.0/dist/js/bootstrap-material-design.js"/>-->
</body>
</html>
15 changes: 15 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
18 changes: 18 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.bg-android{
background-color: #3f51b5 !important;
}

.bg-android-outline{
border: 1px solid #3f51b5;
color: #3f51b5;
border-radius: 2px;
}

.logo{
/*display: flex;*/
padding-right: 5px;
}

*:focus{
outline: none;
}
15 changes: 15 additions & 0 deletions src/components/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React, { Component } from 'react';
// import logo from './logo.svg';
import {CompaniesComponent} from './companies/companies'
import '../App.css';

class App extends Component {
render() {
return(<div>
<CompaniesComponent/>
</div>
);
}
}

export default App;
9 changes: 9 additions & 0 deletions src/components/App.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
ReactDOM.unmountComponentAtNode(div);
});
5 changes: 5 additions & 0 deletions src/components/companies/companies.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@media (max-width: 598.98px) {
.oi, .filter{
display: none;
}
}
94 changes: 94 additions & 0 deletions src/components/companies/companies.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import React, {Component} from 'react'
import { getCompanies } from '../shared/services/company-service'
import './companies.css'

const companies = getCompanies();

const isSearched = searchTerm => company =>
company.name.toLowerCase().includes(searchTerm.toLowerCase());

export class CompaniesComponent extends Component {
constructor(props) {
super(props);

this.state = {
companies,
searchTerm: ''
};

this.onSearchChange = this.onSearchChange.bind(this);
this.onDismiss = this.onDismiss.bind(this);
}

onSearchChange(event){
this.setState({searchTerm: event.target.value})
}

onDismiss(id){
const updatedCompanies = this.state.companies.filter(company => company.objectID !==id );
this.setState({updatedCompanies});

}

render() {
const {companies, searchTerm } = this.state;
return (
<div class="container mt-3">
<div class="card">
<div class="card-body">
<SearchBar
value={searchTerm}
onChange={this.onSearchChange}/>
</div>
</div>
<div class="row">
{companies.filter(isSearched(searchTerm)).map(company =>
<div class="col-md-6">
<div class="card my-2">
<div class="card-body" key={company.objectID}>
<h4 class="card-title">{company.name}</h4>
{/*<p class="card-text">Tags: {company.tag_list}</p>*/}
<p class="card-text">Category:{company.category_code}</p>
<a class="card-text" href={company.homepage_url}>URL:{company.homepage_url}</a>
</div>
</div>
</div>)}
</div>
</div>
);
}
}

class SearchBar extends Component {

render() {
const { value, onChange } = this.props;
return (
<div class="row mx-sm-1 my-1 justify-content-between">
<div>
<ul class="nav nav-pills mt-2">
<li class="nav-item">
<p class="lead pt-1 filter">Filter by:</p></li>
<li class="nav-item px-md-1">
<button type="button" class="btn btn-primary active">All</button>
</li>
<li class="nav-item px-md-1">
<button type="button" class="btn btn-primary">Location</button>
</li>
<li class="nav-item px-md-1">
<button type="button" class="btn btn-primary">Category</button>
</li>
</ul>
</div>
<div>
<form class="form-inline">
<input class="form-control mr-sm-1" placeholder='Search' value={value} onChange={onChange} id="searchBar"/>
<span class="oi oi-magnifying-glass"/>
</form>
</div>
</div>
);
}
}

// export default CompaniesComponent
Empty file.
10 changes: 10 additions & 0 deletions src/components/companies/company-details/company-details.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React, { Component } from 'react';
import './company-details.css'

class CompanyDetails extends Component{
render(){
return <div>it Works</div>
}
}

export default CompanyDetails
Empty file.
Loading