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

Prizes component. #97

Merged
merged 21 commits into from
Jan 3, 2021
Merged

Prizes component. #97

merged 21 commits into from
Jan 3, 2021

Conversation

w-gao
Copy link
Contributor

@w-gao w-gao commented Dec 7, 2020

Problem

As a hacker,
I want to see the available prices
So I can get excited about them!

Link to Asana Ticket

Solution

The layout is similar to the Milestones component, expect this one doesn't have any images/graphics associated with it. I had to copy over some of the mixins/variables from #91, but they will be removed after that PR is pulled in.

In the figma design, the first half of the Prizes section belongs to the Milestones section. I had to use separate backgrounds for the two sections to not deal with negative margins. The integrated design looks like this:

I don't see a clear way to share a background with another component without messing up the spacing somehow, but feedback / suggestions would be greatly appreciated.

Change summary:

Steps to Verify:

  1. Checkout branch and run yarn run start to start a local web server.
  2. Verify the Prizes section is present and responsive.

@w-gao w-gao requested a review from a team as a code owner December 7, 2020 06:57
@w-gao w-gao added the enhancement New feature or request label Dec 7, 2020
Comment on lines 35 to 39
margin: 0;
color: var(--white);
font-family: $font-family-italic;
font-style: italic;
font-weight: normal;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of duplicating code here, can we extend from the mixin already defined? We might also be able to use our -- notation, but I'm also not sure if that's correct again.

Copy link
Member

@ejmockler ejmockler Dec 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tim-nguyen-cs the two dashes -- is a CSS naming convention for variables. propose any changes you find to be worthwhile!

@tim-nguyen-cs
Copy link
Contributor

Nice job so far, @w-gao! My recommendation to overlap fields would to probably use some negative margin if you haven't already to move this section up. Would it also be possible to adjust the padding/dimensions of each prize box to hold a square (instead of vertically rectangular) shape?

Right now, it looks like this on my screen, so I'm hoping it'll be more proportioned when the rest of the sections are in:
image

Copy link
Member

@ejmockler ejmockler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, this component is definitely most of the way there! Just had some comments regarding the background & shadow effects.

Comment on lines 35 to 39
margin: 0;
color: var(--white);
font-family: $font-family-italic;
font-style: italic;
font-weight: normal;
Copy link
Member

@ejmockler ejmockler Dec 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tim-nguyen-cs the two dashes -- is a CSS naming convention for variables. propose any changes you find to be worthwhile!

/* Delete these lines when you begin development */
.Prizes {
margin: 0;
background: url("~images/components/prizes/background.svg") repeat-y;
Copy link
Member

@ejmockler ejmockler Dec 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I'd advise against confining the background to a single CSS prop; it looks like the image is being cropped. A CSS class would lend enough granularity to scale the entire image! The background layers have a bit more complexity than a single image; I think a separate background container will really help here.

implementation:
Screenshot from 2020-12-09 09-22-49

design:
Screenshot from 2020-12-09 09-23-13

Copy link
Member

@ejmockler ejmockler Dec 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also we can include the glowing shadow effect using CSS! https://www.w3schools.com/css/css3_shadows.asp
ah I see you've already got the prop set, we can nail it to the design with a bit of tweaking

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mocklee A separate background container would make sense so I will update #91 and this PR. However, I'm still unsure how to repeat the SVG without using the background-repeat prop. This was needed so the background can cover the entire section on small screens.

Copy link
Member

@ejmockler ejmockler Dec 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of repeating the grid SVG, its height & width can be set proportional to a container. if it doesn't size properly on smaller screens, consider jumping into the SVG & defining preserveAspectRatio="none" to lend a bit more flexibility with resizing: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio

@w-gao w-gao added the work in progress PR is a work in progress label Dec 10, 2020
@w-gao w-gao marked this pull request as draft December 10, 2020 02:43
@w-gao w-gao mentioned this pull request Dec 10, 2020
5 tasks
# Conflicts:
#	src/stylesheets/_typography.scss
#	src/stylesheets/_variables.scss
#	src/views/Home/index.view.tsx
@w-gao w-gao marked this pull request as ready for review December 20, 2020 02:40
Copy link
Member

@ejmockler ejmockler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work tying this in with the milestones component.

Just a small aesthetic issue on mobile we may not have time to address, but worth noting: I suggest using the mobile breakpoints to keep the grid somewhat present & framed with the grid in milestones instead of having it disappear.

@@ -1,8 +1,72 @@
import React from "react";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#71 allows us to remove this statement completely if we do not use react within a file; however, since we use it here we can simply do: import * as React from "react";. With newer versions of react and typescript coming out, if react is not used within a file, you don't have to import react. It's pretty neat stuff!

@ejmockler ejmockler merged commit 8689c85 into main Jan 3, 2021
@ejmockler ejmockler deleted the feature/prizes-component branch January 3, 2021 05:26
ilopezro pushed a commit that referenced this pull request Jan 3, 2021
* Prizes component.

* Update background to its own layer.

* Fix merge issue.

* Adjust background.

* Fix merge conflict.

* Fix colors.

* integrate components; responsive to tab-land

* serialize prize topics using typescript

* serialize FAQ using typescript

* responsive patch for FAQ header text

* adjust sponsor section margin

* adjust sponsor section margin

* faq header margin on smallest

* proofread copywriting

* raise max nesting depth for pseudoelements

also add new pinnacle logo

* new pinnacle logo responsive

* lint scss

Co-authored-by: Eric Mockler <emockler@ucsc.edu>
Co-authored-by: mocklee <mock7ee@gmail.com>
ilopezro pushed a commit that referenced this pull request Jan 3, 2021
* Prizes component.

* Update background to its own layer.

* Fix merge issue.

* Adjust background.

* Fix merge conflict.

* Fix colors.

* integrate components; responsive to tab-land

* serialize prize topics using typescript

* serialize FAQ using typescript

* responsive patch for FAQ header text

* adjust sponsor section margin

* adjust sponsor section margin

* faq header margin on smallest

* proofread copywriting

* raise max nesting depth for pseudoelements

also add new pinnacle logo

* new pinnacle logo responsive

* lint scss

Co-authored-by: Eric Mockler <emockler@ucsc.edu>
Co-authored-by: mocklee <mock7ee@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request work in progress PR is a work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants