-
Notifications
You must be signed in to change notification settings - Fork 1
Add testimonials section with carousel #45
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| import Glide from '@glidejs/glide' | ||
| import { rem } from 'polished' | ||
| import { useEffect } from 'react' | ||
| import styled from 'styled-components' | ||
| import Slide from './slide' | ||
| import '@glidejs/glide/dist/css/glide.core.min.css' | ||
| import '@glidejs/glide/dist/css/glide.theme.min.css' | ||
|
|
||
| const DOT_SIZE = rem('18px') | ||
| const DOT_SIZE_MOBILE = rem('24px') | ||
|
|
||
| const Root = styled.div` | ||
| margin-top: ${rem('64px')}; | ||
| cursor: default; | ||
| ` | ||
|
|
||
| const Track = styled.div` | ||
| margin-bottom: ${rem('64px')}; | ||
| position: relative; | ||
| cursor: grab; | ||
|
|
||
| .glide__slide { | ||
| height: 100%; | ||
| } | ||
| ` | ||
|
|
||
| const ControlDots = styled.div` | ||
| display: flex; | ||
| justify-content: center; | ||
| width: 100%; | ||
| position: relative; | ||
| ` | ||
|
|
||
| const DotButton = styled.button` | ||
| height: ${DOT_SIZE}; | ||
| width: ${DOT_SIZE}; | ||
| border-radius: 50%; | ||
| background: rgba(255, 104, 186, 0.5); | ||
| margin: 0.5rem; | ||
| border: none; | ||
| transition: all 0.3s ease; | ||
| cursor: pointer; | ||
|
|
||
| &.glide__bullet--active { | ||
| background: rgba(255, 104, 186, 1); | ||
| } | ||
|
|
||
| &:focus { | ||
| outline: none; | ||
| transform: scale(1.25); | ||
| } | ||
|
|
||
| @media only screen and (max-width: 413px) { | ||
| height: ${DOT_SIZE_MOBILE}; | ||
| width: ${DOT_SIZE_MOBILE}; | ||
| } | ||
| ` | ||
|
|
||
| const Testimonials = () => { | ||
| useEffect(() => { | ||
| new Glide('.glide', { | ||
| type: 'carousel', | ||
| perView: 1, | ||
| }).mount() | ||
| }, []) | ||
|
|
||
| return ( | ||
| <Root className="glide"> | ||
| <Track className="glide__track" data-glide-el="track"> | ||
| <ul className="glide__slides"> | ||
| <li className="glide__slide"> | ||
| <Slide | ||
| imgSrc="/testimonial-1.jpg" | ||
| imgAlt="Clara Tsang" | ||
| heading="Clara Tsang" | ||
| subHeading="Commit Engineering Partner" | ||
| text="Commit offers me a flexible working situation where | get to work on a wide spread of projects to build my career. It’s an amazing opportunity to learn from such a great community of engineers and choose from projects and technologies that actually interest me and can lead to exciting long term opportunities." | ||
| /> | ||
| </li> | ||
| <li className="glide__slide"> | ||
| <Slide | ||
| imgSrc="/testimonial-2.jpg" | ||
| imgAlt="Bill Monkman" | ||
| heading="Bill Monkman" | ||
| subHeading="Commit Engineering Partner" | ||
| text="I joined Commit to work with inspiring engineers and to help my renew my focus on what I'm most interested in working on." | ||
| /> | ||
| </li> | ||
| <li className="glide__slide"> | ||
| <Slide | ||
| imgSrc="/testimonial-3.jpg" | ||
| imgAlt="Sim Brar" | ||
| heading="Sim Brar" | ||
| subHeading="Commit Engineering Partner" | ||
| text="Commit is the perfect place to make a career transition. I can try new startups without the time suck of interviews or blotches on my resume. I also avoid the financial risks and admin of going on my own as a freelancer" | ||
| /> | ||
| </li> | ||
| </ul> | ||
| </Track> | ||
| <ControlDots data-glide-el="controls[nav]"> | ||
| <DotButton | ||
| type="button" | ||
| aria-label="Testimonial 1" | ||
| data-glide-dir="=0" | ||
| /> | ||
| <DotButton | ||
| type="button" | ||
| aria-label="Testimonial 2" | ||
| data-glide-dir="=1" | ||
| /> | ||
| <DotButton | ||
| type="button" | ||
| aria-label="Testimonial 3" | ||
| data-glide-dir="=2" | ||
| /> | ||
| </ControlDots> | ||
| </Root> | ||
| ) | ||
| } | ||
|
|
||
| export default Testimonials | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| import { rem } from 'polished' | ||
| import { string } from 'prop-types' | ||
| import styled from 'styled-components' | ||
| import { Heading, Text } from 'components' | ||
|
|
||
| const IMG_WIDTH = '280px' | ||
| const IMG_HEIGHT = '200px' | ||
|
|
||
| const Root = styled.div` | ||
| display: flex; | ||
| margin: 0 17%; | ||
|
|
||
| @media only screen and (max-width: 1023px) { | ||
| margin: 0 10%; | ||
| } | ||
|
|
||
| @media only screen and (max-width: 767px) { | ||
| flex-direction: column; | ||
| align-items: center; | ||
| } | ||
|
|
||
| @media only screen and (max-width: 413px) { | ||
| margin: 0; | ||
| } | ||
| ` | ||
|
|
||
| const Content = styled.div` | ||
| display: flex; | ||
| flex-direction: column; | ||
| margin-left: 24px; | ||
|
|
||
| h3 { | ||
| font-size: ${rem('24px')}; | ||
| line-height: ${rem('24px')}; | ||
| font-weight: 700; | ||
| margin-bottom: 0; | ||
|
|
||
| strong { | ||
| display: block; | ||
| font-weight: 700; | ||
| font-size: ${rem('16px')}; | ||
| line-height: ${rem('26px')}; | ||
| color: #657594; | ||
| margin-top: ${rem('12px')}; | ||
| } | ||
| } | ||
|
|
||
| p { | ||
| margin-top: ${rem('12px')}; | ||
| text-align: left; | ||
| } | ||
|
|
||
| @media only screen and (max-width: 1023px) { | ||
| p { | ||
| text-align: left; | ||
| } | ||
| } | ||
|
|
||
| @media only screen and (max-width: 767px) { | ||
| align-items: center; | ||
|
|
||
| h3 { | ||
| text-align: center; | ||
| margin-top: ${rem('16px')}; | ||
| } | ||
|
|
||
| p { | ||
| text-align: center; | ||
| } | ||
| } | ||
| ` | ||
|
|
||
| const Img = styled.img` | ||
| min-width: ${IMG_WIDTH}; | ||
| max-width: ${IMG_WIDTH}; | ||
| min-height: ${IMG_HEIGHT}; | ||
| max-height: ${IMG_HEIGHT}; | ||
| object-fit: cover; | ||
| ` | ||
|
|
||
| const Slide = ({ imgSrc, imgAlt, heading, subHeading, text, ...props }) => ( | ||
| <Root {...props}> | ||
| <Img src={imgSrc} alt={imgAlt} /> | ||
| <Content> | ||
| <Heading variant={Heading.VARIANT.h3}> | ||
| {heading} | ||
| <strong>{subHeading}</strong> | ||
| </Heading> | ||
| <Text>{text}</Text> | ||
| </Content> | ||
| </Root> | ||
| ) | ||
|
|
||
| Slide.propTypes = { | ||
| imgSrc: string, | ||
| imgAlt: string, | ||
| heading: string, | ||
| subHeading: string, | ||
| text: string, | ||
| } | ||
|
|
||
| export default Slide |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Maybe we want to move styles to
components/testimonials/styles.jsWhat you guys think? @superkhau @timothy-wan
Uh oh!
There was an error while loading. Please reload this page.
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.
Well styled components are laid out like this anyway. I'm good leaving like this