Skip to content

Commit

Permalink
DEVX-75 adding banner to point to MVP site.
Browse files Browse the repository at this point in the history
  • Loading branch information
sheaphillips committed Oct 3, 2023
1 parent 356b88b commit 3d6bd38
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 3 deletions.
48 changes: 48 additions & 0 deletions web/src/components/UI/Link/ButtonLink.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
Copyright 2019 Province of British Columbia
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Created by Patrick Simonian
*/

import React from 'react';
import PropTypes from 'prop-types';
import Link from './Link';
import styled from '@emotion/styled';

const ButtonLink = ({ to, children, ...rest }) => (
<Link to={to} {...rest}>
{children}
</Link>
);

const StyledLink = styled(ButtonLink)`
background-color: ${({ theme }) => theme.colors.blue};
font-weight: 400;
text-align: center;
color: white;
border-radius: 5px;
display: block;
margin: 0 auto;
padding: 0.5em;
width: 150px;
text-decoration: none;
`;

ButtonLink.propTypes = {
to: PropTypes.string.isRequired,
children: PropTypes.string.isRequired,
};

export default StyledLink;
3 changes: 2 additions & 1 deletion web/src/components/UI/Link/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Link from './Link';
import SearchAwareLink from './SearchAwareLink';
import ChevronLink from './ChevronLink';
export { Link, SearchAwareLink, ChevronLink };
import ButtonLink from './ButtonLink';
export { Link, SearchAwareLink, ChevronLink, ButtonLink };
36 changes: 34 additions & 2 deletions web/src/hoc/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState } from 'react';
import { graphql } from 'gatsby';
import PropTypes from 'prop-types';
import styled from '@emotion/styled';
import { Container } from 'reactstrap';
import { Alert, Container } from 'reactstrap';
import Helmet from 'react-helmet';

// layout local components
Expand All @@ -11,6 +11,7 @@ import PrimaryFooter from '../components/PrimaryFooter/PrimaryFooter';
import { Navbar } from '../components/Navbar/Navbar';

import { MAIN_NAV_ROUTE_LIST } from '../constants/routes';
import { ButtonLink } from '../components/UI/Link';

const StyledContainer = styled(Container)`
min-height: 100vh;
Expand All @@ -27,6 +28,17 @@ const Wrapper = styled.div`
}
`;

const RetirementNotice = styled(Alert)`
width: 70%;
margin-left: auto;
margin-right: auto;
margin-top: 25px;
margin-bottom: 15px;
padding: 20px;
`;

const utmLink =
'https://mvp.developer.gov.bc.ca/?utm_source=devhub-classic&utm_medium=web&utm_campaign=retirement-notice-oct-2023';
export const Layout = ({ children }) => {
const [menuToggled, setMenuToggled] = useState(false);
return (
Expand All @@ -39,7 +51,27 @@ export const Layout = ({ children }) => {

<Navbar links={MAIN_NAV_ROUTE_LIST} toggled={menuToggled} />

<Wrapper>{children}</Wrapper>
<Wrapper>
<RetirementNotice color="primary">
<h4 className="alert-heading">We're working on a new and improved DevHub!</h4>
<p>
Please try our MVP at{' '}
<a href={utmLink} className="alert-link">
https://mvp.developer.gov.bc.ca
</a>
, and{' '}
<a href="mailto:developer.experience@gov.bc.ca" className="alert-link">
let us know
</a>{' '}
what's missing to make it useful for you.
</p>
{/*<hr/>*/}
<p>
<ButtonLink to={utmLink}>Test it out!</ButtonLink>
</p>
</RetirementNotice>
{children}
</Wrapper>
<PrimaryFooter />
</StyledContainer>
);
Expand Down

0 comments on commit 3d6bd38

Please sign in to comment.