From 2c3889fa4d26fa7b3d9c8cd556e5716cb231313c Mon Sep 17 00:00:00 2001 From: ijemmao Date: Thu, 9 Dec 2021 19:36:49 -0500 Subject: [PATCH] fix(site): render local assets, change email, and render press --- next.config.js | 27 +- package.json | 9 +- postcss.config.js | 11 +- src/config.js | 2 +- src/fonts.css | 36 + src/{pages/general.less => general.css} | 2 +- src/pages/404.js | 4 +- src/pages/App.js | 13 +- src/pages/_app.js | 4 +- src/pages/about.js | 4 +- src/pages/assets/images/builtInAfrica.png | Bin 0 -> 12210 bytes src/pages/assets/images/nigerianTribune.png | Bin 0 -> 18022 bytes src/pages/assets/images/nuesroom.png | Bin 0 -> 7119 bytes src/pages/assets/images/umuIgboUnite.png | Bin 0 -> 18722 bytes src/pages/assets/images/weDeyCode.png | Bin 0 -> 17960 bytes src/pages/components/Demo/Demo.js | 13 +- .../components/MentionedIn/MentionedIn.js | 50 + src/pages/components/MentionedIn/index.js | 3 + src/pages/components/Navbar/Navbar.js | 14 +- src/pages/components/Navbar/SubMenu.js | 9 +- src/pages/components/Statistics/Stat.js | 2 +- src/pages/components/Statistics/Statistics.js | 2 +- src/pages/fonts.less | 31 - src/pages/fonts/silka-black-webfont.eot | Bin 31092 -> 0 bytes src/pages/fonts/silka-black-webfont.ttf | Bin 78912 -> 0 bytes src/pages/fonts/silka-black-webfont.woff | Bin 38432 -> 0 bytes src/pages/fonts/silka-black-webfont.woff2 | Bin 27260 -> 0 bytes src/pages/fonts/silka-bold-webfont.eot | Bin 80466 -> 0 bytes src/pages/fonts/silka-bold-webfont.ttf | Bin 80192 -> 0 bytes src/pages/fonts/silka-bold-webfont.woff | Bin 39540 -> 0 bytes src/pages/fonts/silka-bold-webfont.woff2 | Bin 28180 -> 0 bytes src/pages/fonts/silka-regular-webfont.eot | Bin 30308 -> 0 bytes src/pages/fonts/silka-regular-webfont.ttf | Bin 79536 -> 0 bytes src/pages/fonts/silka-regular-webfont.woff | Bin 37904 -> 0 bytes src/pages/fonts/silka-regular-webfont.woff2 | Bin 26472 -> 0 bytes src/pages/signup.js | 3 +- src/siteConstants.js | 2 +- src/{pages/styles.less => styles.css} | 50 +- tailwind.config.js | 8 +- yarn.lock | 3186 ++++++----------- 40 files changed, 1365 insertions(+), 2120 deletions(-) create mode 100644 src/fonts.css rename src/{pages/general.less => general.css} (96%) create mode 100644 src/pages/assets/images/builtInAfrica.png create mode 100644 src/pages/assets/images/nigerianTribune.png create mode 100644 src/pages/assets/images/nuesroom.png create mode 100644 src/pages/assets/images/umuIgboUnite.png create mode 100644 src/pages/assets/images/weDeyCode.png create mode 100644 src/pages/components/MentionedIn/MentionedIn.js create mode 100644 src/pages/components/MentionedIn/index.js delete mode 100644 src/pages/fonts.less delete mode 100755 src/pages/fonts/silka-black-webfont.eot delete mode 100755 src/pages/fonts/silka-black-webfont.ttf delete mode 100755 src/pages/fonts/silka-black-webfont.woff delete mode 100755 src/pages/fonts/silka-black-webfont.woff2 delete mode 100755 src/pages/fonts/silka-bold-webfont.eot delete mode 100755 src/pages/fonts/silka-bold-webfont.ttf delete mode 100755 src/pages/fonts/silka-bold-webfont.woff delete mode 100755 src/pages/fonts/silka-bold-webfont.woff2 delete mode 100755 src/pages/fonts/silka-regular-webfont.eot delete mode 100755 src/pages/fonts/silka-regular-webfont.ttf delete mode 100755 src/pages/fonts/silka-regular-webfont.woff delete mode 100755 src/pages/fonts/silka-regular-webfont.woff2 rename src/{pages/styles.less => styles.css} (77%) diff --git a/next.config.js b/next.config.js index 23995378..ba638650 100644 --- a/next.config.js +++ b/next.config.js @@ -1,21 +1,16 @@ -/* eslint-disable */ -const withLess = require('@zeit/next-less'); - -module.exports = withLess({ +module.exports = { distDir: 'build/dist', generateBuildId: async () => 'api-homepage', - webpack: (config, { isServer }) => { + plugins: [], + webpack: (config) => { config.module.rules.push({ test: /\.svg$/, - use: ['@svgr/webpack'] + use: ['@svgr/webpack'], }); - // Fixes npm packages that depend on `fs` module - if (!isServer) { - config.node = { - fs: 'empty' - } - } - - return config - } -}); + config.module.rules.push({ + test: /\.(png|jpe?g|gif|woff|woff2|eot|ttf|otf)$/, + use: 'file-loader', + }); + return config; + }, +}; diff --git a/package.json b/package.json index f56fba67..f00e6586 100644 --- a/package.json +++ b/package.json @@ -69,8 +69,6 @@ "@material-ui/core": "^4.11.0", "@sendgrid/mail": "^7.4.0", "@testing-library/cypress": "^7.0.3", - "@zeit/next-css": "^1.0.1", - "@zeit/next-less": "^1.0.1", "antd": "^4.14.0", "autoprefixer": "^9.8.6", "axios": "^0.21.1", @@ -85,12 +83,12 @@ "express-rate-limit": "^5.2.3", "heroku-ssl-redirect": "^0.1.1", "joi": "^17.4.0", - "less": "^4.1.1", "lodash": "^4.17.20", "migrate-mongo": "^8.1.4", "mongoose": "^5.10.7", "morgan": "^1.10.0", - "next": "^9.5.5", + "next": "12.0.7", + "next-react-svg": "^1.1.3", "node-cron": "^2.0.3", "nodemon": "^2.0.4", "prop-types": "^15.7.2", @@ -106,7 +104,7 @@ "shelljs": "^0.8.4", "string-similarity": "^4.0.2", "swagger-ui-express": "^4.1.4", - "tailwindcss": "^1.9.5", + "tailwindcss": "3", "unicharadata": "^9.0.0-alpha.6", "uuid": "^8.3.2", "yarn": "^1.22.10" @@ -142,6 +140,7 @@ "eslint-plugin-jsx-a11y": "^6.3.1", "eslint-plugin-react": "^7.21.3", "esm": "^3.2.25", + "file-loader": "^6.2.0", "husky": "^4.3.0", "lint-staged": "^10.4.0", "mocha": "^8.1.3", diff --git a/postcss.config.js b/postcss.config.js index 8eb0d0f0..3687d286 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,7 +1,8 @@ -/* eslint-disable */ +// If you want to use other PostCSS plugins, see the following: +// https://tailwindcss.com/docs/using-with-preprocessors module.exports = { - plugins: [ - require('tailwindcss'), - require('autoprefixer'), - ], + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, }; diff --git a/src/config.js b/src/config.js index e6880a1d..88ee8364 100644 --- a/src/config.js +++ b/src/config.js @@ -74,7 +74,7 @@ export const API_ROUTE = process.env.NODE_ENV === 'production' ? '' : `http://lo // SendGrid API export const SENDGRID_API_KEY = process.env.SENDGRID_API_KEY || ''; export const NEW_DEVELOPER_ACCOUNT_TEMPLATE = process.env.NEW_DEVELOPER_ACCOUNT_TEMPLATE || ''; -export const API_FROM_EMAIL = process.env.API_FROM_EMAIL || 'igboapi@gmail.com'; +export const API_FROM_EMAIL = process.env.API_FROM_EMAIL || 'kedu@nkowaokwu.com'; if (sgMail) { sgMail.setApiKey(SENDGRID_API_KEY); diff --git a/src/fonts.css b/src/fonts.css new file mode 100644 index 00000000..a8c74bf6 --- /dev/null +++ b/src/fonts.css @@ -0,0 +1,36 @@ +@font-face { + font-family: 'Silka'; + src: url('./public/fonts/silka-regular-webfont.eot'); + src: url('./public/fonts/silka-regular-webfont.eot?#iefix') format('embedded-opentype'), + url('./public/fonts/silka-regular-webfont.woff2') format('woff2'), + url('./public/fonts/silka-regular-webfont.woff') format('woff'), + url('./public/fonts/silka-regular-webfont.ttf') format('truetype'); + font-weight: normal; + +} + +@font-face { + font-family: 'Silka'; + src: url('./public/fonts/silka-bold-webfont.eot'); + src: url('./public/fonts/silka-bold-webfont.eot?#iefix') format('embedded-opentype'), + url('./public/fonts/silka-bold-webfont.woff2') format('woff2'), + url('./public/fonts/silka-bold-webfont.woff') format('woff'), + url('./public/fonts/silka-bold-webfont.ttf') format('truetype'); + font-weight: 700; + +} + +@font-face { + font-family: 'Silka'; + src: url('./public/fonts/silka-black-webfont.eot'); + src: url('./public/fonts/silka-black-webfont.eot?#iefix') format('embedded-opentype'), + url('./public/fonts/silka-black-webfont.woff2') format('woff2'), + url('./public/fonts/silka-black-webfont.woff') format('woff'), + url('./public/fonts/silka-black-webfont.ttf') format('truetype'); + font-weight: 900; +} + +@font-face { + font-family: 'Inter'; + src: url('./public/fonts/Inter/Inter-VariableFont_slnt\,wght.ttf'); +} \ No newline at end of file diff --git a/src/pages/general.less b/src/general.css similarity index 96% rename from src/pages/general.less rename to src/general.css index 89d8f5c1..b1a0115c 100644 --- a/src/pages/general.less +++ b/src/general.css @@ -1,7 +1,7 @@ /* Style sheet dedicated to element tag styling */ html { width: 100vw; - font-family: sans-serif; + font-family: 'Inter', sans-serif; font-weight: normal; } diff --git a/src/pages/404.js b/src/pages/404.js index 1c933766..20723f85 100644 --- a/src/pages/404.js +++ b/src/pages/404.js @@ -1,3 +1,5 @@ import React from 'react'; -export default () =>
whoops
; +const Error = () =>
whoops
; + +export default Error; diff --git a/src/pages/App.js b/src/pages/App.js index 38702314..71b66e7b 100644 --- a/src/pages/App.js +++ b/src/pages/App.js @@ -8,7 +8,8 @@ import Demo from './components/Demo'; import Card from './components/Card'; import Footer from './components/Footer'; import WorkersAroundHeart from './assets/workers-around-heart.svg'; -import Statistics from './components/Statistics/Statistics'; +import Statistics from './components/Statistics'; +import MentionedIn from './components/MentionedIn'; import { GITHUB_REPO, DICTIONARY_APP_URL } from '../siteConstants'; const App = ({ searchWord, words }) => { @@ -54,7 +55,7 @@ const App = ({ searchWord, words }) => {

@@ -118,7 +121,7 @@ const Demo = ({ searchWord, words }) => {

Response

diff --git a/src/pages/components/MentionedIn/MentionedIn.js b/src/pages/components/MentionedIn/MentionedIn.js new file mode 100644 index 00000000..fd07cde0 --- /dev/null +++ b/src/pages/components/MentionedIn/MentionedIn.js @@ -0,0 +1,50 @@ +import React from 'react'; +import NigerianTribune from '../../../public/icons/nigerianTribune.svg'; +import UmuIgboUnite from '../../../public/icons/umuIgboUnite.svg'; +import BuiltInAfrica from '../../../public/icons/builtInAfrica.svg'; +import Nuesroom from '../../../public/icons/nuesroom.svg'; +import WeDeyCode from '../../../public/icons/weDeyCode.svg'; + +const NIGERIAN_TRIBUNE = ( + `https://tribuneonlineng.com/why-i-created-first-igbo-english- + online-open-to-contribute-dictionary-app-ijemma-onwuzulike/` +); +const UIU = ( + 'https://www.ozisco.com/tag/nkowa-okwu/' +); +const BUILT_IN_AFRICA = ( + 'https://www.builtinafrica.io/blog-post/ijemma-onwuzulike-igbo-api' +); +const NUESROOM = ( + 'https://neusroom.com/her-igbo-parents-didnt-teach-her-the-language-so-ijemma-onwuzulike-built-her-own-dictionary/' +); +const WEDEYCODE = ( + 'https://www.youtube.com/watch?v=kjHi7p1j-ts' +); + +const MentionedIn = () => ( +
+
+ + + + + + + + + + + + + + + +
+
+); + +export default MentionedIn; diff --git a/src/pages/components/MentionedIn/index.js b/src/pages/components/MentionedIn/index.js new file mode 100644 index 00000000..26267464 --- /dev/null +++ b/src/pages/components/MentionedIn/index.js @@ -0,0 +1,3 @@ +import MentionedIn from './MentionedIn'; + +export default MentionedIn; diff --git a/src/pages/components/Navbar/Navbar.js b/src/pages/components/Navbar/Navbar.js index 3b9ec154..77ffd5b3 100644 --- a/src/pages/components/Navbar/Navbar.js +++ b/src/pages/components/Navbar/Navbar.js @@ -6,7 +6,7 @@ import SubMenu from './SubMenu'; import IgboAPI from '../../assets/igboAPI.svg'; import downchevron from '../../assets/downchevron.svg'; -const menuIcon = process.env.NODE_ENV !== 'production' ? downchevron : '/assets/downchevron.svg'; +const MenuIcon = process.env.NODE_ENV !== 'production' ? downchevron : '/assets/downchevron.svg'; const Navbar = ({ to, isHomepage, transparent }) => { const [isMenuVisible, setIsMenuVisible] = useState(false); @@ -40,14 +40,14 @@ const Navbar = ({ to, isHomepage, transparent }) => { className={`transition-element mr-5 lg:mr-0 ${isMenuVisible ? 'transform rotate-90' : ''}`} onClick={() => setIsMenuVisible(!isMenuVisible)} > - down arrow as menu icon + ) : null} - {matchesLargeScreenQuery ? ( - - ) : isMenuVisible ? ( - - ) : null} +
); }; diff --git a/src/pages/components/Navbar/SubMenu.js b/src/pages/components/Navbar/SubMenu.js index 63be39f8..687918b0 100644 --- a/src/pages/components/Navbar/SubMenu.js +++ b/src/pages/components/Navbar/SubMenu.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import { useRouter } from 'next/router'; import { Link } from 'react-scroll'; -const SubMenu = ({ isHomepage, transparent }) => { +const SubMenu = ({ isVisible, isHomepage, transparent }) => { const router = useRouter(); const navigate = (e, url) => { e.preventDefault(); @@ -11,7 +11,11 @@ const SubMenu = ({ isHomepage, transparent }) => { }; return ( -