Skip to content

Commit

Permalink
feat: buy now functionality using stripe
Browse files Browse the repository at this point in the history
  • Loading branch information
Param-Harrison committed May 17, 2020
1 parent 491813a commit 2e80ec5
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 61 deletions.
15 changes: 8 additions & 7 deletions src/components/footer.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from "react";
import { Link } from "gatsby";
import { Box, Flex, Text } from "@chakra-ui/core";
import styled from "@emotion/styled";

const StyledLink = styled(Link)`
import { StyledLink } from "./shared";

const FooterLink = styled(StyledLink)`
text-decoration: none;
margin-left: 10px;
margin-left: 16px;
`;

const Footer = () => {
Expand All @@ -14,15 +15,15 @@ const Footer = () => {
<Flex width="100%" maxW="720px" m="0 auto" alignItems="center">
<Box>
<Text as="span">© {new Date().getFullYear()} </Text>
<Text as="span" color="yellow.400">
<Text as="span" color="red.400">
learnwithparam.com
</Text>
</Box>
<Box as="nav" ml="auto">
<StyledLink to="/support/terms-and-conditions">
<FooterLink to="/support/terms-and-conditions">
Terms and Conditions
</StyledLink>
<StyledLink to="/support/privacy-policy">Privacy policy</StyledLink>
</FooterLink>
<FooterLink to="/support/privacy-policy">Privacy policy</FooterLink>
</Box>
</Flex>
</Box>
Expand Down
28 changes: 28 additions & 0 deletions src/components/shared.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from "react";
import { Link } from "gatsby";
import styled from "@emotion/styled";
import { Flex, Box } from "@chakra-ui/core";

export const StyledLink = styled(Link)`
color: ${props => `${props.theme.colors.yellow[400]}`};
Expand All @@ -8,3 +10,29 @@ export const StyledLink = styled(Link)`
color: ${props => `${props.theme.colors.yellow[600]}`};
}
`;

export const StyledAnchor = styled.a`
color: ${props => `${props.theme.colors.yellow[400]}`};
text-decoration: underline;
&:hover {
color: ${props => `${props.theme.colors.yellow[600]}`};
}
`;

export const HeroContainer = ({ children, ...props }) => {
return (
<Flex
as="section"
maxW="720px"
minH="calc(100vh - 190px)"
mx="auto"
my="3"
p="3"
alignItems="center"
>
<Box {...props} maxW="600px" my="60px" mx="auto">
{children}
</Box>
</Flex>
);
};
45 changes: 31 additions & 14 deletions src/pages/about.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React from "react";
import { useStaticQuery, graphql } from "gatsby";
import { Heading, Text } from "@chakra-ui/core";

import Layout from "../components/layout";
import SEO from "../components/seo";
import { StyledAnchor, HeroContainer } from "../components/shared";

const AboutPage = () => {
const data = useStaticQuery(graphql`
Expand All @@ -21,20 +23,35 @@ const AboutPage = () => {
return (
<Layout>
<SEO title="About" />
<h1>About</h1>
<p>
We are Eco Shop selling the merchandise for{" "}
<a rel="noopener noreferrer" href={siteUrl} target="_blank">
Learn with Param
</a>
</p>
<p>
You can reach me out in{" "}
<a rel="noopener noreferrer" href={twitterUrl} target="_blank">
twitter
</a>
</p>
<p>Site created by {author}</p>
<HeroContainer>
<Heading as="h2" fontSize="2xl" textTransform="uppercase" mb="3">
About
</Heading>
<Text>
We are Eco Shop selling the merchandise for{" "}
<StyledAnchor
rel="noopener noreferrer"
href={siteUrl}
target="_blank"
>
Learn with Param
</StyledAnchor>
</Text>
<Text>
You can reach me out in{" "}
<StyledAnchor
rel="noopener noreferrer"
href={twitterUrl}
target="_blank"
>
twitter
</StyledAnchor>
</Text>
<Text>
Site created by
{author}
</Text>
</HeroContainer>
</Layout>
);
};
Expand Down
26 changes: 8 additions & 18 deletions src/pages/cancel.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,19 @@
import React from "react";
import { Flex, Box, Heading } from "@chakra-ui/core";
import { Heading } from "@chakra-ui/core";

import Layout from "../components/layout";
import SEO from "../components/seo";
import { StyledLink } from "../components/shared";
import { StyledLink, HeroContainer } from "../components/shared";

const CancelPage = () => (
<Layout>
<SEO title="Order Cancelled" />
<Flex
as="section"
maxW="720px"
minH="calc(100vh - 190px)"
mx="auto"
my="3"
p="3"
alignItems="center"
>
<Box textAlign="center" maxW="600px" my="60px" mx="auto">
<Heading as="h2" fontSize="2xl" textTransform="uppercase" mb="3">
You can check out our other products
</Heading>
<StyledLink to="/">Explore products</StyledLink>
</Box>
</Flex>
<HeroContainer textAlign="center">
<Heading as="h2" fontSize="2xl" textTransform="uppercase" mb="3">
You can check out our other products
</Heading>
<StyledLink to="/">Explore products</StyledLink>
</HeroContainer>
</Layout>
);

Expand Down
26 changes: 8 additions & 18 deletions src/pages/success.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,19 @@
import React from "react";
import { Flex, Box, Heading } from "@chakra-ui/core";
import { Heading } from "@chakra-ui/core";

import Layout from "../components/layout";
import SEO from "../components/seo";
import { StyledLink } from "../components/shared";
import { StyledLink, HeroContainer } from "../components/shared";

const SuccessPage = () => (
<Layout>
<SEO title="Order Successful" />
<Flex
as="section"
maxW="720px"
minH="calc(100vh - 190px)"
mx="auto"
my="3"
p="3"
alignItems="center"
>
<Box textAlign="center" maxW="600px" my="60px" mx="auto">
<Heading as="h2" fontSize="2xl" textTransform="uppercase" mb="3">
Order has been placed Successfully
</Heading>
<StyledLink to="/">Explore products</StyledLink>
</Box>
</Flex>
<HeroContainer textAlign="center">
<Heading as="h2" fontSize="2xl" textTransform="uppercase" mb="3">
Order has been placed Successfully
</Heading>
<StyledLink to="/">Explore products</StyledLink>
</HeroContainer>
</Layout>
);

Expand Down
10 changes: 8 additions & 2 deletions src/pages/support/privacy-policy.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import React from "react";
import { Heading, Text } from "@chakra-ui/core";

import Layout from "../../components/layout";
import SEO from "../../components/seo";
import { HeroContainer } from "../../components/shared";

const PrivacyPage = () => (
<Layout>
<SEO title="Privacy Policy" />
<h1>Privacy policy</h1>
<p>Privacy is a Myth!</p>
<HeroContainer>
<Heading as="h2" fontSize="2xl" textTransform="uppercase" mb="3">
Privacy policy
</Heading>
<Text>Privacy is a Myth!</Text>
</HeroContainer>
</Layout>
);

Expand Down
10 changes: 8 additions & 2 deletions src/pages/support/terms-and-conditions.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import React from "react";
import { Heading, Text } from "@chakra-ui/core";

import Layout from "../../components/layout";
import SEO from "../../components/seo";
import { HeroContainer } from "../../components/shared";

const TermsPage = () => (
<Layout>
<SEO title="Terms & Conditions" />
<h1>Terms & Conditions</h1>
<p>IT jobs are subjected to market risk!</p>
<HeroContainer>
<Heading as="h2" fontSize="2xl" textTransform="uppercase" mb="3">
Terms & Conditions
</Heading>
<Text>IT jobs are subjected to market risk!</Text>
</HeroContainer>
</Layout>
);

Expand Down

0 comments on commit 2e80ec5

Please sign in to comment.