Skip to content

Commit

Permalink
Fix frontend/backend volume binding, use Bulma instead of Tailwind
Browse files Browse the repository at this point in the history
  • Loading branch information
rikkit committed Jul 1, 2020
1 parent 37ed872 commit 4d5b9d8
Show file tree
Hide file tree
Showing 13 changed files with 929 additions and 7,666 deletions.
6 changes: 3 additions & 3 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ services:
frontend:
command: yarn dev
volumes:
- ./node_modules:/usr/src/backend/node_modules
- ./src/frontend:/usr/src/frontend
- ./node_modules:/usr/src/frontend/node_modules
environment:
HTTPS_PROXY: https://proxy
backend:
command: yarn dev
volumes:
- ./src/backend:/usr/src/backend
- ./node_modules:/usr/src/backend/node_modules
- ./src/backend/.tmp:/usr/src/backend/.tmp
- ./src/backend/public:/usr/src/backend/public
ports:
- "1337:1337"
proxy:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"typescript": "~3.9"
},
"workspaces": [
"packages/*"
"src/*"
]
}
2 changes: 0 additions & 2 deletions src/frontend/.env.local.example

This file was deleted.

10 changes: 7 additions & 3 deletions src/frontend/components/cover-image.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import Link from 'next/link'

export default function CoverImage({ title, url, slug }) {
if (!url) {
return null;
}

const imageUrl = `${
url.startsWith('/') ? process.env.NEXT_PUBLIC_STRAPI_API_URL : ''
}${url}`
}${url}`
return (
<div className="-mx-5 sm:mx-0">
{slug ? (
Expand All @@ -13,8 +17,8 @@ export default function CoverImage({ title, url, slug }) {
</a>
</Link>
) : (
<img src={imageUrl} alt={title} />
)}
<img src={imageUrl} alt={title} />
)}
</div>
)
}
4 changes: 2 additions & 2 deletions src/frontend/lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export async function getAllPostsForHome(preview) {
`
query Posts($where: JSON){
posts(sort: "created_at:desc", where: $where) {
title
title
slug
created_at
excerpt
Expand Down Expand Up @@ -84,7 +84,7 @@ export async function getPostAndMorePosts(slug, preview) {
`
query PostBySlug($where: JSON, $where_ne: JSON) {
posts(where: $where) {
title
title
slug
created_at
excerpt
Expand Down
7 changes: 4 additions & 3 deletions src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@
"start": "next start"
},
"dependencies": {
"bulma": "^0.9.0",
"classnames": "2.2.6",
"date-fns": "2.14.0",
"isomorphic-unfetch": "3.0.0",
"next": "latest",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"remark": "12.0.0",
"remark-html": "11.0.2"
"remark-html": "11.0.2",
"sass": "^1.26.9"
},
"devDependencies": {
"@types/node": "~12",
"@types/react": "^16.9.41",
"postcss-flexbugs-fixes": "4.2.1",
"postcss-preset-env": "^6.7.0",
"tailwindcss": "^1.4.6"
"postcss-preset-env": "^6.7.0"
}
}
2 changes: 1 addition & 1 deletion src/frontend/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '@/styles/index.css'
import '@/styles/index.scss'

function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
Expand Down
6 changes: 4 additions & 2 deletions src/frontend/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import Layout from '@/components/layout'
import { getAllPostsForHome } from '@/lib/api'
import Head from 'next/head'
import { CMS_NAME } from '@/lib/constants'
import { InferGetStaticPropsType, GetStaticProps } from "next"

export default function Index({ allPosts, preview }) {

export default function Index({ allPosts, preview }: InferGetStaticPropsType<typeof getStaticProps>) {
const heroPost = allPosts[0]
const morePosts = allPosts.slice(1)
return (
Expand Down Expand Up @@ -35,7 +37,7 @@ export default function Index({ allPosts, preview }) {
)
}

export async function getStaticProps({ preview = null }) {
export const getStaticProps: GetStaticProps = async ({ preview = null }) => {
const allPosts = (await getAllPostsForHome(preview)) || []
return {
props: { allPosts, preview },
Expand Down
1 change: 0 additions & 1 deletion src/frontend/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module.exports = {
plugins: [
'tailwindcss',
'postcss-flexbugs-fixes',
[
'postcss-preset-env',
Expand Down
7 changes: 0 additions & 7 deletions src/frontend/styles/index.css

This file was deleted.

6 changes: 6 additions & 0 deletions src/frontend/styles/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

@import "~bulma";

.grayscale {
filter: grayscale(1);
}
Loading

0 comments on commit 4d5b9d8

Please sign in to comment.