-
Notifications
You must be signed in to change notification settings - Fork 0
Main Page Begins #21
base: master
Are you sure you want to change the base?
Main Page Begins #21
Conversation
src/Home/Home.tsx
Outdated
padding: 3, | ||
}); | ||
|
||
const RectangleThing = glamorous.div({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this component into a separate file. I think maybe a more descriptive name than RectangleThing
might also be a good idea--perhaps PageLink
, since that's what each rectangle will contain?
src/index.js
Outdated
@@ -0,0 +1,9 @@ | |||
import React from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this file, you can delete it!
src/Home/Home.tsx
Outdated
<Div | ||
className="link-grid" | ||
display="grid" | ||
grid-template-columns="repeat(3,400px)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make CSS grid responsive! Check this out for details: https://medium.com/samsung-internet-dev/common-responsive-layouts-with-css-grid-and-some-without-245a862f48df
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think inline styles like this are ok? I know we're using glamorous, but I've thinking of starting a css file for Home because I felt that was cleaner. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or is that defeating the purpose of using glamorous
src/Home/Home.tsx
Outdated
backgroundColor: 'rgba(255, 255, 255, 0.8)', | ||
}); | ||
|
||
// const LinkGrid = glamorous.div({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comments if we aren't using them!
src/Home/Home.tsx
Outdated
} | ||
} | ||
|
||
ReactDOM.render(<Home />, document.getElementById('root')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't be rendering DOM elements here, that's what the index file is for. Instead make sure this component included in the component!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see. So index renders App which renders all the page components like Home, Profile, Shows, etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend checking out App.tsx and index.tsx to see how this works! index.tsx is the file that is compiled behind the scenes.
Codecov Report
@@ Coverage Diff @@
## master #21 +/- ##
==========================================
+ Coverage 62.2% 67.32% +5.11%
==========================================
Files 12 14 +2
Lines 127 153 +26
Branches 15 18 +3
==========================================
+ Hits 79 103 +24
- Misses 48 50 +2
Continue to review full report at Codecov.
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<meta name="theme-color" content="#000000"> | ||
<!-- | ||
<html lang="en" style="max-width:100%; overflow-x:hidden;"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are adding these attributes to the html
and body
tags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a fix I found online to prevent horizontal scrolling!
src/Home/Home.tsx
Outdated
} | ||
} | ||
|
||
// ReactDOM.render(<Home />, document.getElementById('root')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comment
src/Home/Home.tsx
Outdated
grid-column-gap="30px" | ||
padding="50px" | ||
> | ||
{/* { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this comment for now, we'll come back to dynamically populating the page soon.
src/Home/Home.tsx
Outdated
render() { | ||
return ( | ||
<Div margin="5px auto" padding="20px" width="100%"> | ||
<Div id="nav" display="flex"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the semantic nav element here instead of a div!
src/Home/Home.tsx
Outdated
<Div | ||
className="buttonGroup" | ||
display="grid" | ||
grid-template-columns="5vw 5vw 5vw" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure vw is the best unit to use here. Isn't fr usually used for grids?
Note to peers
❗Please please point out anything that doesn't make sense, won't be scalable, doesn't take advantage of the frameworks at my disposal, or is just ugly in your opinion. #roastme because I want to know what I'm doing.
Types of changes
Purpose
Create the main page for panel following login screen.
Learning
Still trying to understand components and props in React. Used egghead.io videos.
Considered using flexbox react addon, but discussed with Nathan about using css grid instead. Thanks to Wes Bos and MDN for engaging CSS Grid tut
Screenshot(s)
Checklist
master
without error.