Created 'Get involved' page -- need some help#871
Created 'Get involved' page -- need some help#871kylemh merged 29 commits intoOperationCode:masterfrom ksmacleod99:getInvolved
Conversation
also adds an image
Commits storybook info and I really hope it doesn't break anything
Hero banner component and Get Involved page
Styles header
it will never end
|
@ksmacleod99 re: 'some storybook info got sucked up into a commit, please advise on how to remove' - perhaps you ran one of the storybook NPM scripts while developing. I've noticed that this has a tendency to add (unwanted) changes that will be committed to Git. The offending commit appears to be 73977ca . Since you've already submitted this PR and others may have pulled in this code to collab/review it, I would run The other option would be to use git's interactive rebase feature to delete commit 73977ca (which rewrites history), and then |
This reverts commit 73977ca.
|
@jjhampton I think I did it... how bad did I break it? |
|
@ksmacleod99 It looks like your revert commit got rid of some of the unwanted Storybook-related changes from commit 73977ca, but not all of them. The other files that have unwanted Storybook-related changes (and should have changes reversed by
If you run |
This reverts commit 73977ca.
|
If the story book commits are gone, it should be good to go. I can work on isLeftFocus/isRightFocus on a different PR. |
scripts/imageSize.js
Outdated
| } else { | ||
| console.log('Test successful 💪 💪 💪 💪 💪 💪'); | ||
| process.exit(0); | ||
| } |
There was a problem hiding this comment.
Weird, this is the same file that's already been committed to master at 112fb6c.
There was a problem hiding this comment.
lol what - how is this even possible
There was a problem hiding this comment.
Because when I screw stuff up, I do it right. Go big or go home!
| padding-left: 75px; | ||
| margin-top: 30px; | ||
| line-height: normal; | ||
| } |
There was a problem hiding this comment.
These CSS selectors seem too specific for these li elements with class .check (used here and in the media queries above). There's really no need to use HTML tag + className in a chained selector unless you are overriding something else. Otherwise, it makes this component's CSS a bit more difficult to extend (by adding styles in the future).
CSS class name alone is sufficient here, the class check is not being used on any other elements within this component. You generally want to keep the specificity of your CSS selectors low, if possible.
https://css-tricks.com/strategies-keeping-css-specificity-low/
(edit) ^ also applies to the Volunteer and WhyGive component CSS styles.
There was a problem hiding this comment.
Thanks! I'll fiddle with it.
| flex-flow: row wrap; | ||
| align-items: center; | ||
| justify-content: space-around; | ||
| } No newline at end of file |
There was a problem hiding this comment.
This applies to all files in 'src/scenes/home/getInvolved/successStories':
This isn't very DRY - instead of copying over the entire SuccessStories component over to 'src'/scenes/home/getInvolved' from 'src/scenes/home/landing', if that component is going to be used on two scenes, it should probably be moved one level up to 'src/shared/components' so it can have a common reference point.
There was a problem hiding this comment.
I think it was discussed that we might remove success stories from the home page to un-clutter it a little. But I will do whatever is decided upon.
| c-1.2,1.9-3.7,2.9-7.5,2.9c-3.9,0-6.1-0.2-6.8-0.5c-1.8-0.8-4-4.9-6.4-12.3c-2.8-8.2-4.2-13.3-4.2-15.4c0-2.2,1.9-4.4,5.6-6.5 | ||
| C377.9,253.8,380,253.2,381.8,253.2"/> | ||
| </g> | ||
| </svg> |
There was a problem hiding this comment.
Are this file and 'src/images/icons/check.svg' both needed? I only see one reference to a check.svg added in this PR.
| link="https://opencollective.com/operationcode#support" | ||
| isExternal | ||
| /> | ||
| <LinkButton text="Volunteer" theme="blue" link="/signup" /> |
There was a problem hiding this comment.
I don't think this LinkButton component needs to be nested here inside of the HeroBanner - I don't see any buttons anywhere?
There was a problem hiding this comment.
Nuts - that's something I lost track of. It's on the wireframes to have a button in the hero banner. I'll remove it for now, and I can create an issue to try to allow link buttons as possible child components in the hero banner component.
| @@ -0,0 +1,39 @@ | |||
| form { | |||
There was a problem hiding this comment.
Is there a reason for these styles targeting form elements? I don't see any forms in the markup, and also don't see .pageHeading used within this component. May not be needed.
There was a problem hiding this comment.
We also cannot allow element level styles. If there is/are elements you need to apply styles to, inline them or make a class for them.
| subtitle: PropTypes.string, | ||
| isLeftFocus: PropTypes.bool, | ||
| isCenterFocus: PropTypes.bool, | ||
| isRightFocus: PropTypes.bool |
There was a problem hiding this comment.
@ksmacleod99 If you're wanting to hold off on using the properties isLeftFocus, isRightFocus, and isCenterFocus, best to just remove those properties here (they're not being used).
If you're trying to set different properties on something, you could have a corresponding CSS class for each of those boolean properties, inside ./heroBanner.css. Then, inside heroBanner.js you could use some JS logic to add the correct class to the JSX.
There was a problem hiding this comment.
@ksmacleod99 - This looks really good - I really like all of the images chosen, the svg checkmarks, and the new HeroBanner component.
Besides the comments I added to the code, I noticed that some of the responsive layout is a bit off at when emulating smaller screen sizes (mainly iPad / tablet / larger mobile phones) on Chrome DevTools. A few instances of elements overlapping/off-center. I don't think that's a show-stopper, but if we merge this without fixing that, then we should probably create a separate issue for it.
Also - will we link to this page from anywhere in the main app (or externally) ?
scripts/imageSize.js
Outdated
| } else { | ||
| console.log('Test successful 💪 💪 💪 💪 💪 💪'); | ||
| process.exit(0); | ||
| } |
There was a problem hiding this comment.
lol what - how is this even possible
src/images/icons/check.svg
Outdated
| <path d="m432.17 211.89c-45.767 0-83.03 37.263-83.03 83.03-1e-5 45.767 37.263 83.03 83.03 83.03 45.767 1e-5 83.03-37.263 83.03-83.03 0-19.786-6.6953-37.48-18.065-51.976l-7.8178 9.2659c9.9118 12.204 13.791 25.754 13.791 42.71 0 39.221-31.718 70.92-70.939 70.92s-70.939-31.699-70.939-70.92 31.718-70.939 70.939-70.939c12.428 0 21.724 1.7866 31.872 7.3911l7.4275-9.7539c-11.882-6.5621-24.797-9.7286-39.299-9.7286z" fill-rule="evenodd"/> | ||
| <path d="m401.44 284c3.3481 9e-5 5.8807 2.7473 7.5977 8.2416 3.4339 10.302 5.8807 15.453 7.3402 15.453 1.116 5e-5 2.275-0.85844 3.477-2.5755 24.124-38.632 46.445-69.882 66.963-93.748 5.3226-6.181 13.779-9.2716 25.369-9.2718 2.7471 1.7e-4 4.5928 0.25771 5.5373 0.77264 0.94418 0.51527 1.4164 1.1592 1.4165 1.9316-1.7e-4 1.2021-1.4167 3.563-4.2496 7.0826-33.138 39.835-63.873 81.901-92.203 126.2-1.9746 3.0906-6.0096 4.636-12.105 4.6359-6.1812 3e-5 -9.8299-0.25753-10.946-0.77267-2.919-1.2877-6.353-7.8552-10.302-19.703-4.4642-13.135-6.6964-21.377-6.6963-24.725-5e-5 -3.6056 3.0047-7.0826 9.0143-10.431 3.6915-2.0603 6.9538-3.0905 9.7869-3.0906"/> | ||
| </g> | ||
| </svg> |
There was a problem hiding this comment.
I'm a big fan of SVGs, but we already have FA Icons involved as a dependency. See if you can leverage Font Awesome instead of this SVG (and the one you saved under /getInvolved
| @@ -0,0 +1,39 @@ | |||
| form { | |||
There was a problem hiding this comment.
We also cannot allow element level styles. If there is/are elements you need to apply styles to, inline them or make a class for them.
| } | ||
|
|
||
| @media (max-width:500px){ | ||
| form { |
| text-align: center; | ||
| } | ||
|
|
||
| ul { |
There was a problem hiding this comment.
Please no styles applied to elements. We don't have style splitting - any styles applied to elements get applied globally. It happens a few other times in the PR, so please just skim it for the culprits - I'll stop commenting on this issue going forward.
| const SuccessStories = () => ( | ||
| <Section title="Success Stories" theme="white"> | ||
| <div className={styles.successStoriesContent}> | ||
| <ImageListItem image={image1} title={content.items[0].title} cardText={content.items[0].body} /> |
There was a problem hiding this comment.
Once you've changed the content file to a .js file, you can use .map to spread the data across like so
| margin-top: 0; | ||
| } | ||
|
|
||
| .button { |
There was a problem hiding this comment.
This class shouldn't be necessary.
| <Route path="/terms" component={Terms} /> | ||
| <Route path="/chapter_leader" component={ChapterLeader} /> | ||
| <Route path="/leadership_circle" component={LeadershipCircle} /> | ||
| <Route path="/get-involved" component={GetInvolved} /> |
There was a problem hiding this comment.
can you also add a Route for "/get_involved". I think you can use <Redirect>
There was a problem hiding this comment.
@kylemh Is this due to usage of kebap-case vs snake_case? This won't be the only route that could use redirect to address that - there's several others in home.js already - we've had inconsistencies with route naming for quite some time.
Let's just create another issue to add redirects for all of those at once, so we can finish up this Get Involved page.
| import PropTypes from 'prop-types'; | ||
| import styles from './heroBanner.css'; | ||
|
|
||
| const propTypes = { |
There was a problem hiding this comment.
for the sake of intellisense in editors, I'd prefer these variables be named with a _ in front to discern between the prop-types API and the actual variable names.
There was a problem hiding this comment.
Can you explain a little more? When I add an underscore before propTypes ES Lint throws an error, "Unexpected dangling '_' in '_propTypes' no-underscore-dangle"
There was a problem hiding this comment.
Looks like we might want to turn off this ESLint rule: https://eslint.org/docs/rules/no-underscore-dangle
|
|
||
| storiesOf('HeroBanner', module).add('Default', () => ( | ||
| <HeroBanner imageSrc={jamesBondJpg} title="Bond" subtitle="James Bond" /> | ||
| )); |
There was a problem hiding this comment.
bless your soul for keeping Storybook up-to-date.
There was a problem hiding this comment.
I'm trying. I have no idea what I'm doing and it's not working, but I'm trying lol
|
@ksmacleod99 This one's been open for quite some time now - how's it coming along? Do you need any help getting this finished up? |
|
I have everything except the redirect and the dangling underscore |
This was removed in 27e9b64, but somehow got re-added. Not needed, as it stopped working.
Remove unused propTypes Assign propTypes object to class property instead of variable
Removed unneeded CSS styles Remove display: table and switch to flexbox Prevented header text from displaying over people in the hero background image
Added mobile-friendly styles Added whitespace btw/ checkmark and text
Redundant, already on landing page We can add other valuable content to this page later
|
@ksmacleod99 @wimo7083 @kylemh Updates:
After this is merged, we can work on the following. I'll create new issues as needed:
|
Description of changes
Makes a Get Involved page
Issue Resolved
Satisfies Issue #12
Needs review; and I don't know how to begin with the styles for the isLeftFocused, isRighFocused, etc booleans. Needs path to volunteer page.
Also, some storybook info got sucked up into a commit, please advise on how to remove (or fix so it works properly :D )