forked from mozilla/price-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix mozilla#274: Add UR study participation UI
Notes: - I had to put the copy in brackets in StudyInvitation.jsx to be able to use the apostrophe it contains. This avoids the eslint rule error react/no-unescaped-entities. - The panels are wider than bryanbell's mocks, but the PR for mozilla#256 will fix that.
- Loading branch information
1 parent
c04cb82
commit 5accc1e
Showing
7 changed files
with
196 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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 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,10 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
/** Study footer styles */ | ||
|
||
.menu-item.study { | ||
justify-content: center; | ||
border-top: 1px solid var(--grey-30); | ||
} |
This file contains 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,32 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import autobind from 'autobind-decorator'; | ||
import pt from 'prop-types'; | ||
import React from 'react'; | ||
|
||
import 'commerce/browser_action/components/StudyFooter.css'; | ||
|
||
/** | ||
* Feedback footer for User Research study recruitment. | ||
*/ | ||
@autobind | ||
export default class StudyFooter extends React.Component { | ||
static propTypes = { | ||
// Direct props | ||
onClick: pt.func.isRequired, | ||
} | ||
|
||
render() { | ||
return ( | ||
<button | ||
type="button" | ||
className="menu-item study" | ||
onClick={this.props.onClick} | ||
> | ||
Help us improve Price Wise... | ||
</button> | ||
); | ||
} | ||
} |
This file contains 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,52 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
/** Components for the StudyInvitation screen */ | ||
|
||
.title-bar.study { | ||
justify-content: flex-start; | ||
position: relative; | ||
} | ||
|
||
.title-bar.study .title { | ||
position: absolute; | ||
left: 50%; | ||
top: 50%; | ||
transform: translate(-50%, -50%); | ||
} | ||
|
||
.study-invitation { | ||
align-items: center; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
margin: 16px; | ||
text-align: center; | ||
} | ||
|
||
.study-invitation .hero { | ||
height: 123px; | ||
width: 142px; | ||
} | ||
|
||
.study-invitation .description { | ||
margin: 0; | ||
} | ||
|
||
.study-invitation .participate.button { | ||
width: 100%; | ||
} | ||
|
||
.participate.button:enabled { | ||
color: var(--white-100); | ||
background-color: var(--blue-60); | ||
} | ||
|
||
.participate.button:hover:enabled { | ||
background: var(--blue-70); | ||
} | ||
|
||
.participate.button:active:enabled { | ||
background: var(--blue-80); | ||
} |
This file contains 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,56 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import autobind from 'autobind-decorator'; | ||
import pt from 'prop-types'; | ||
import React from 'react'; | ||
|
||
import 'commerce/browser_action/components/StudyInvitation.css'; | ||
|
||
/** | ||
* Study Invitation page for when users click the StudyFooter | ||
*/ | ||
@autobind | ||
export default class StudyInvitation extends React.Component { | ||
static propTypes = { | ||
// Direct props | ||
onClickBack: pt.func.isRequired, | ||
onClickParticipate: pt.func.isRequired, | ||
} | ||
|
||
render() { | ||
return ( | ||
<React.Fragment> | ||
<div className="title-bar study"> | ||
<button | ||
className="ghost back button" | ||
type="button" | ||
onClick={this.props.onClickBack} | ||
title="Back to Products" | ||
> | ||
<img | ||
className="icon" | ||
src={browser.extension.getURL('img/back.svg')} | ||
alt="Back to Products" | ||
/> | ||
</button> | ||
<h1 className="title">Feedback</h1> | ||
</div> | ||
<div className="study-invitation"> | ||
<img className="hero" src={browser.extension.getURL('img/shopping-welcome.svg')} alt="" /> | ||
<p className="description"> | ||
{"Help us improve Price Wise by participating in a research study. Take this 5-minute survey to learn more about the study and see if you're a fit."} | ||
</p> | ||
<button | ||
className="button participate" | ||
type="button" | ||
onClick={this.props.onClickParticipate} | ||
> | ||
Take a 5-minute survey | ||
</button> | ||
</div> | ||
</React.Fragment> | ||
); | ||
} | ||
} |
This file contains 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.