-
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.
- Loading branch information
Showing
16 changed files
with
200 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
{ | ||
"start": { | ||
"title": "Dod o hyd i leoedd i ailgylchu." | ||
}, | ||
"about": { | ||
"title": "About this service", | ||
"intro": "Powered by RecycleNow.com, this tool can be used to search and find recycling locations throughout the United Kingdom.", | ||
"becomeAPartner": { | ||
"title": "Add this tool to your website", | ||
"description": "It’s been created as an embeddable widget that can be added to any website to help visitors discover more recycling options. For example, a beverage manufacturer could use the tool to show places to recycle drinks cans.", | ||
"cta": "Become a partner", | ||
"url": "https://wrap.org.uk/taking-action/citizen-behaviour-change/recycle-now/recycling-locator-tool" | ||
}, | ||
"feedback": { | ||
"title": "Improving this service", | ||
"description": "We’re always looking to improve this tool and would be interested to hear about your experience whilst using it, good or bad.", | ||
"cta": "Feedback on this tool", | ||
"url": "https://wrapcymru.org.uk/contact-wrap-cymru" | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,5 +1,21 @@ | ||
{ | ||
"start": { | ||
"title": "Find places to recycle." | ||
}, | ||
"about": { | ||
"title": "About this service", | ||
"intro": "Powered by RecycleNow.com, this tool can be used to search and find recycling locations throughout the United Kingdom.", | ||
"becomeAPartner": { | ||
"title": "Add this tool to your website", | ||
"description": "It’s been created as an embeddable widget that can be added to any website to help visitors discover more recycling options. For example, a beverage manufacturer could use the tool to show places to recycle drinks cans.", | ||
"cta": "Become a partner", | ||
"url": "https://wrap.org.uk/taking-action/citizen-behaviour-change/recycle-now/recycling-locator-tool" | ||
}, | ||
"feedback": { | ||
"title": "Improving this service", | ||
"description": "We’re always looking to improve this tool and would be interested to hear about your experience whilst using it, good or bad.", | ||
"cta": "Feedback on this tool", | ||
"url": "https://wrap.org.uk/contact-us" | ||
} | ||
} | ||
} |
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,7 @@ | ||
locator-header { | ||
align-items: center; | ||
display: flex; | ||
gap: var(--diamond-spacing); | ||
justify-content: space-between; | ||
padding: var(--diamond-spacing-sm) var(--diamond-spacing); | ||
} |
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,18 @@ | ||
import { Meta, StoryObj } from '@storybook/preact'; | ||
|
||
import './Header'; | ||
|
||
const meta: Meta = { | ||
title: 'Components/Header', | ||
}; | ||
|
||
export default meta; | ||
|
||
export const Header: StoryObj = { | ||
render: () => ( | ||
<locator-header> | ||
<div style="border:1px solid black">Flex header</div> | ||
<div style="border:1px solid black">With gap</div> | ||
</locator-header> | ||
), | ||
}; |
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,9 @@ | ||
import { CustomElement } from '../../types/custom-element'; | ||
|
||
declare module 'preact' { | ||
namespace JSX { | ||
interface IntrinsicElements { | ||
'locator-header': CustomElement; | ||
} | ||
} | ||
} |
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.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ locator-layout { | |
|
||
&::part(main) { | ||
grid-area: main; | ||
overflow: auto; | ||
} | ||
|
||
&::part(aside) { | ||
|
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 was deleted.
Oops, something went wrong.
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,36 @@ | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
export default function AboutPage() { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<> | ||
<h2>{t('about.title')}</h2> | ||
<p>{t('about.intro')}</p> | ||
<h3 className="diamond-spacing-top-md"> | ||
{t('about.becomeAPartner.title')} | ||
</h3> | ||
<p>{t('about.becomeAPartner.description')}</p> | ||
<diamond-button width="full-width"> | ||
<a | ||
href={t('about.becomeAPartner.url')} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
{t('about.becomeAPartner.cta')} | ||
</a> | ||
</diamond-button> | ||
<h3 className="diamond-spacing-top-md">{t('about.feedback.title')}</h3> | ||
<p>{t('about.feedback.description')}</p> | ||
<diamond-button width="full-width"> | ||
<a | ||
href={t('about.feedback.url')} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
{t('about.feedback.cta')} | ||
</a> | ||
</diamond-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,50 @@ | ||
import { Outlet, Link, useHref } from 'react-router-dom'; | ||
|
||
import '../../components/Layout/Layout'; | ||
import '../../components/Logo/Logo'; | ||
import '../../components/Icon/Icon'; | ||
import '../../components/Header/Header'; | ||
import '../../components/Tip/Tip'; | ||
import '../../components/Wrap/Wrap'; | ||
|
||
function InfoButton({ open }: { readonly open: boolean }) { | ||
const to = open ? '/' : '/about'; | ||
const icon = open ? 'close' : 'info'; | ||
|
||
return ( | ||
<diamond-button variant="text"> | ||
<Link to={to}> | ||
<locator-icon icon={icon} color="primary"></locator-icon> | ||
</Link> | ||
</diamond-button> | ||
); | ||
} | ||
|
||
export default function StartLayout() { | ||
const path = useHref(); | ||
|
||
return ( | ||
<locator-layout> | ||
<locator-header slot="header"> | ||
<locator-logo slot="header"></locator-logo> | ||
<InfoButton open={path === '/about'} /> | ||
</locator-header> | ||
<locator-wrap slot="main"> | ||
<diamond-section padding="lg"> | ||
<Outlet /> | ||
</diamond-section> | ||
</locator-wrap> | ||
<locator-tip slot="aside"> | ||
<locator-wrap> | ||
<p>Use this service to:</p> | ||
<ul> | ||
<li>see your nearest places to recycle</li> | ||
<li>find out how to recycle a specific item</li> | ||
<li>check what you can recycle at home</li> | ||
</ul> | ||
<img src="/images/recycling-technology.webp" alt="" /> | ||
</locator-wrap> | ||
</locator-tip> | ||
</locator-layout> | ||
); | ||
} |
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,22 @@ | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import '../../components/LocationInput/LocationInput'; | ||
|
||
export default function StartPage() { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<> | ||
<h2>{t('start.title')}</h2> | ||
<form> | ||
<diamond-form-group class="diamond-spacing-bottom-md"> | ||
<label htmlFor="location-input">Where are you?</label> | ||
<locator-location-input></locator-location-input> | ||
</diamond-form-group> | ||
<diamond-button width="full-width" variant="primary"> | ||
<button type="submit">Get started</button> | ||
</diamond-button> | ||
</form> | ||
</> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,18 +1,21 @@ | ||
:host { | ||
--diamond-button-background: var(--color-white); | ||
--diamond-button-background-hover: var(--diamond-button-background); | ||
--diamond-button-background-hover: var(--theme-background-accent); | ||
--diamond-button-background-disabled: var(--diamond-button-background); | ||
--diamond-button-border-color: var(--color-green); | ||
--diamond-button-border-color-hover: var(--color-green-dark); | ||
--diamond-button-border-color-disabled: var(--color-green-light); | ||
--diamond-button-color: var(--diamond-button-border-color); | ||
--diamond-button-color-hover: var(--diamond-button-border-color-hover); | ||
--diamond-button-color-disabled: var(--diamond-button-border-color-disabled); | ||
--diamond-button-padding-block: 0.75rem; | ||
|
||
--diamond-button-primary-background: var(--color-green); | ||
--diamond-button-primary-background-hover: var(--color-green-dark); | ||
--diamond-button-primary-background-disabled: var(--color-green-light); | ||
--diamond-button-primary-color: var(--color-white); | ||
--diamond-button-primary-color-hover: var(--diamond-button-primary-color); | ||
--diamond-button-primary-color-disabled: var(--diamond-button-primary-color); | ||
|
||
--diamond-button-text-background-hover: var(--theme-background-accent); | ||
} |
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