-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Site Profiler: Update styles for Results Header section (#91016)
* Change color of the button when is busy * Remove flag from new components as it is not needed * Site Profiler: Add initial version of Results Header component * Update styles of header and display form when clicking CTA * Add the green background svg and logic to display it * update top spacing * fix type conversion issues * Update client/site-profiler/components/get-report-form/index.tsx Co-authored-by: Wesley Berrêdo <Wberredo@gmail.com> * update text class names * accept prettier suggestion --------- Co-authored-by: Gergely Csécsey <gcsecsey@gmail.com> Co-authored-by: Gergely Csécsey <gergely.csecsey@automattic.com> Co-authored-by: Wesley Berrêdo <Wberredo@gmail.com>
- Loading branch information
1 parent
c52ec27
commit 8007270
Showing
9 changed files
with
402 additions
and
53 deletions.
There are no files selected for viewing
100 changes: 100 additions & 0 deletions
100
client/assets/images/site-profiler/background-results-bad.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
100 changes: 100 additions & 0 deletions
100
client/assets/images/site-profiler/background-results-good.svg
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 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
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,51 @@ | ||
import { Button, Gridicon } from '@automattic/components'; | ||
import { translate } from 'i18n-calypso'; | ||
import './styles.scss'; | ||
import { BasicMetricsResult } from 'calypso/data/site-profiler/types'; | ||
|
||
type Props = { | ||
domain: string; | ||
basicMetrics: BasicMetricsResult; | ||
onGetReport: () => void; | ||
}; | ||
|
||
function getIcon() { | ||
// TODO: Implement the functionality to get the correct Icon | ||
// https://github.com/Automattic/dotcom-forge/issues/7281 | ||
return <Gridicon icon="time" size={ 24 } />; | ||
} | ||
|
||
function getDomainMessage() { | ||
// TODO: Implement the functionality to get the correct Icon | ||
// https://github.com/Automattic/dotcom-forge/issues/7281 | ||
return translate( 'This site is not hosted on WordPress.com' ); | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
function getTitleMessage( basicMetrics: BasicMetricsResult ) { | ||
// TODO: Implement the functionality to get the correct title | ||
// https://github.com/Automattic/dotcom-forge/issues/7298 | ||
return translate( 'Your site needs a boost. Let’s improve it.' ); | ||
} | ||
|
||
export const ResultsHeader = ( { domain, basicMetrics, onGetReport }: Props ) => { | ||
return ( | ||
<div className="results-header--container"> | ||
<div className="results-header--domain-container"> | ||
<span className="domain-title">{ domain }</span> | ||
{ getIcon() } | ||
<span className="domain-message">{ getDomainMessage() }</span> | ||
</div> | ||
<h1>{ getTitleMessage( basicMetrics ) }</h1> | ||
<div className="results-header--button-container"> | ||
<Button onClick={ onGetReport }> | ||
{ translate( 'Access full site report - It’s free' ) } | ||
</Button> | ||
<div className="link-component"> | ||
<a href="/site-profiler">{ translate( 'Check another site' ) }</a> | ||
<Gridicon icon="chevron-right" size={ 18 } /> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; |
67 changes: 67 additions & 0 deletions
67
client/site-profiler/components/results-header/styles.scss
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,67 @@ | ||
|
||
@import "@wordpress/base-styles/breakpoints"; | ||
@import "@automattic/typography/styles/variables"; | ||
|
||
.results-header--container { | ||
display: flex; | ||
flex-direction: column; | ||
margin-top: 8rem; | ||
|
||
h1 { | ||
margin-top: 12px; | ||
font-weight: 500; | ||
} | ||
|
||
@media (max-width: $break-small ) { | ||
margin-top: 30px; | ||
h1 { | ||
margin-top: 20px; | ||
} | ||
} | ||
|
||
} | ||
|
||
.results-header--domain-container { | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: 8px; | ||
align-items: center; | ||
font-family: "SF Pro Display", $sans; | ||
|
||
.domain-title { | ||
font-weight: 500; | ||
} | ||
.domain-message { | ||
color: #a8aaad; | ||
|
||
} | ||
|
||
} | ||
.results-header--button-container { | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: 26px; | ||
align-items: center; | ||
margin-top: 48px; | ||
|
||
@media (max-width: $break-small ) { | ||
gap: 16px; | ||
} | ||
|
||
button { | ||
background-color: var(--color-button); | ||
border: none; | ||
color: #fff; | ||
padding: 10px 24px; | ||
|
||
&:hover { | ||
color: #fff; | ||
background-color: var(--color-button-60); | ||
} | ||
} | ||
.link-component { | ||
display: flex; | ||
gap: 10px; | ||
align-items: center; | ||
} | ||
} |
Oops, something went wrong.