Skip to content

Commit

Permalink
fix(website): fix routing pages
Browse files Browse the repository at this point in the history
  • Loading branch information
ijemmao committed Feb 16, 2023
1 parent 7e6541c commit c49a4aa
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 50 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ jobs:
run: yarn test:build
- name: Test API
run: yarn jest
# - name: Test API Homepage
# run: yarn cypress:ci
- name: Test API Homepage
run: yarn cypress:ci
10 changes: 10 additions & 0 deletions __tests__/cypress/integration/client.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ describe('Igbo API Homepage', () => {
cy.contains('Email:');
});

it('render the Privacy page', () => {
cy.findByText('Privacy').click();
cy.findByText('Privacy Policy').should('exist');
});

it('render the Terms or Service page', () => {
cy.findByText('Terms of Service').click();
cy.findByText('Terms and Conditions').should('exist');
});

describe('Try it Out', () => {
it('enter a word and select flag', () => {
cy.visit('/');
Expand Down
3 changes: 2 additions & 1 deletion src/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import { appWithTranslation } from 'next-i18next';
import Head from 'next/head';
import ChakraTheme from '../shared/constants/ChakraTheme';
import en from '../public/locales/en';
import ig from '../public/locales/ig';
import * as gtag from '../lib/gtag';
Expand Down Expand Up @@ -49,7 +50,7 @@ const MainApp = ({ Component, pageProps, ...rest }) => {
<title>Igbo API - The First African Language API</title>
</Head>
<>
<ChakraProvider>
<ChakraProvider theme={ChakraTheme}>
<Component {...pageProps} {...rest} />
</ChakraProvider>
{/* Global Site Tag (gtag.js) - Google Analytics */}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const About = () => {
<a className="link" href={DICTIONARY_APP_URL}>
Nkọwa okwu
</a>
{' , our official online Igbo-English dictionary app.'}
, our official online Igbo-English dictionary app.
</p>
) : (
<p dangerouslySetInnerHTML={{
Expand Down
2 changes: 1 addition & 1 deletion src/pages/components/Footer/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const Footer = () => {
</li>
<li>
<a href="/terms" className="font-normal border-b border-b-gray-500">
Terms of service
Terms of Service
</a>
</li>
<li>
Expand Down
1 change: 0 additions & 1 deletion src/pages/privacy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable max-len */
import React from 'react';
import {
Box,
Expand Down
84 changes: 42 additions & 42 deletions src/pages/terms.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions src/routers/siteRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ const handle = nextApp.getRequestHandler();

const routes = compact([
/^\/$/,
/^\/about/,
process.env.NODE_ENV !== 'production' ? /^\/signup/ : null,
]);

const siteRouter = express.Router();
Expand Down
8 changes: 8 additions & 0 deletions src/shared/constants/ChakraTheme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { extendTheme } from '@chakra-ui/react';

export default extendTheme({
fonts: {
heading: 'Silka',
body: 'Silka,Noto Sans,Inter,-apple-system,BlinkMacSystemFont,Noto Sans,Arial',
},
});
1 change: 1 addition & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
.link {
@apply transition-element;
@apply text-green-400;
@apply inline;
}

.link:hover {
Expand Down

0 comments on commit c49a4aa

Please sign in to comment.