Skip to content

Commit

Permalink
Add browse page
Browse files Browse the repository at this point in the history
  • Loading branch information
avvazana committed Nov 15, 2018
1 parent 89e2deb commit c85b0c3
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 8 deletions.
85 changes: 85 additions & 0 deletions app/assets/stylesheets/components/browse.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
.main-container {
height: 1000px;
background-color: red; /* For browsers that do not support gradients */
background-image: linear-gradient(orange, red, black);
}

// .main-container {
// /* Set rules to fill background */
// min-height: 100%;
// min-width: 1024px;
//
// /* Set up proportionate scaling */
// width: 100%;
// height: auto;
//
// /* Set up positioning */
// position: fixed;
// top: 0;
// left: 0;
// }

.main-container .nav-bar {
height: 100%;
width: 250px;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: #111;
overflow-x: hidden;
padding-top: 20px;
opacity: .9;
}

// .main-container .nav-bar a {
// padding: 6px 8px 6px 16px;
// text-decoration: none;
// font-size: 25px;
// color: purple;
// display: block;
// }
//
// .main-container .nav-bar a:hover {
// color: #f1f1f1;
// }

// @media screen and (max-width: 1024px) { /* Specific to this particular image */
// .main-container {
// left: 50%;
// margin-left: -512px; /* 50% */
// }
// }
//
// .main-container .nav-bar {
// padding: 24px 24px 5px;
// display: -webkit-box;
// display: -ms-flexbox;
// display: flex;
// -webkit-box-orient: vertical;
// -webkit-box-direction: normal;
// -ms-flex-direction: column;
// flex-direction: column;
// height: 100%;
// -webkit-user-select: none;
// -moz-user-select: none;
// -ms-user-select: none;
// user-select: none;
// width: 230px;
// cursor: default;
// }


// body {
// --glue-font-family: "spotify-circular","noto-arabic","Helvetica Neue",Helvetica,Arial,"Hiragino Kaku Gothic Pro","Meiryo","MS Gothic",sans-serif;
// }

// body, button, input {
// font-size: 14px;
// line-height: 20px;
// letter-spacing: .015em;
// font-weight: var(--glue-font-weight-normal);
// color: #b3b3b3;
// text-transform: none;
// font-family: var(--glue-font-family);
// }
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This migration comes from active_storage (originally 20170806125915)
class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
def change
create_table :active_storage_blobs do |t|
t.string :key, null: false
t.string :filename, null: false
t.string :content_type
t.text :metadata
t.bigint :byte_size, null: false
t.string :checksum, null: false
t.datetime :created_at, null: false

t.index [ :key ], unique: true
end

create_table :active_storage_attachments do |t|
t.string :name, null: false
t.references :record, null: false, polymorphic: true, index: false
t.references :blob, null: false

t.datetime :created_at, null: false

t.index [ :record_type, :record_id, :name, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true
end
end
end
4 changes: 2 additions & 2 deletions frontend/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Route, Switch } from 'react-router-dom';
import LoginFormContainer from './session/login_form_container';
import SignupFormContainer from './session/signup_form_container';
import SplashContainer from './splash/splash_container';
// import Browse from './splash/splash';
import Browse from './browse/browse';

const App = () => {
return (
Expand All @@ -13,11 +13,11 @@ const App = () => {
<Switch>
<AuthRoute exact path="/login" component={LoginFormContainer} />
<AuthRoute exact path="/signup" component={SignupFormContainer} />
<ProtectedRoute exact path="/browse" component={Browse}/>
<Route path="/" component={SplashContainer}/>
</Switch>
</div>
)
};
// <ProtectedRoute exact path="/browse" component={Browse}/>

export default App;
5 changes: 3 additions & 2 deletions frontend/components/browse/browse.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ class Browse extends React.Component {

render() {
return (
<div>
<h1>Browse</h1>
<div className="main-container">
<nav className="nav-bar">
</nav>
</div>
);
}
Expand Down
19 changes: 19 additions & 0 deletions frontend/components/browse/browse_container.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { connect } from 'react-redux';
import React from 'react';
import { Link } from 'react-router-dom';
import { login } from '../../actions/session_actions';
import SessionForm from './session_form';

const mapStateToProps = (state) => {
return {

};
};

const mapDispatchToProps = dispatch => {
return {

};
};

export default connect(mapStateToProps, mapDispatchToProps)(SessionForm);
8 changes: 4 additions & 4 deletions frontend/components/splash/splash.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React from 'react';
import { Link } from 'react-router-dom';
import Browse from '../browse/browse';
import { withRouter, Route, Redirect } from 'react-router-dom';


const sessionLinks = () => (
<div className="splash-page">
Expand Down Expand Up @@ -31,10 +34,7 @@ const sessionLinks = () => (
const personalGreeting = (currentUser, logout) => {

return (
<hgroup className="header-group">
<h2 className="header-name">Hi, {currentUser.username}!</h2>
<button className="header-button" onClick={logout}>Log Out</button>
</hgroup>
<Redirect to="/browse" />
)
};

Expand Down

0 comments on commit c85b0c3

Please sign in to comment.