Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed overflow on mobile devices. #177

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/app/(website)/blog/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Link from 'next/link';
import { getPost } from 'lib/blog';
import Markdown from 'components/common/Markdown';
import styles from './page.module.css';
import { notFound } from 'next/navigation';

type Props = {
params: { id: string };
Expand All @@ -13,6 +14,7 @@ export async function generateMetadata({ params }: { params: { id: string } }):
const { id } = params;

const post = await getPost(id);
if(!post) return notFound()

return {
title: {
Expand All @@ -26,9 +28,7 @@ export default async function ({ params }: Props) {
const { id } = params;
const post = await getPost(id);

if (!post) {
return null;
}
if(!post) return notFound()

return (
<article className={styles.blog}>
Expand Down
4 changes: 4 additions & 0 deletions src/app/(website)/docs/[[...id]]/page.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
position: relative;
}

.content {
overflow-x: auto ;
}

@media screen and (max-width: 992px) {
.page {
grid-template-columns: 1fr;
Expand Down
3 changes: 3 additions & 0 deletions src/app/(website)/docs/[[...id]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import { getDoc } from 'lib/docs';
import Markdown from 'components/common/Markdown';
import styles from './page.module.css';
import PageLinks from 'app/(website)/docs/[[...id]]/PageLinks';
import { notFound } from 'next/navigation';

export async function generateMetadata({
params: { id },
}: {
params: { id: string[] };
}): Promise<Metadata> {
const doc = await getDoc(id?.join('/'));
if(!doc) return notFound()

return {
title: {
Expand All @@ -21,6 +23,7 @@ export async function generateMetadata({

export default async function ({ params: { id = [] } }: { params: { id: string[] } }) {
const doc = await getDoc(id?.join('/'));
if(!doc) return notFound()

if (!doc) {
return <h1>Page not found</h1>;
Expand Down
13 changes: 6 additions & 7 deletions src/components/common/Pre.module.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
.container {
position: relative;
background: #000;
display: flex;
flex-direction: row;
justify-content: space-between;
gap:0.75rem;
background: #0d1117;
padding: 16px;
border-radius: 6px;
white-space: pre-wrap;
word-wrap: break-word;
overflow-x: auto;
}

.container code {
Expand All @@ -14,9 +16,6 @@

.button {
border: 0;
position: absolute;
right: 20px;
top: 16px;
height: 16px;
width: 16px;
cursor: pointer;
Expand Down
4 changes: 2 additions & 2 deletions src/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ code {
background: var(--base100);
padding: 2px 4px;
border-radius: 2px;
white-space: pre-wrap;
word-wrap: break-word;
/* white-space: pre-wrap;
word-wrap: break-word; */
letter-spacing: 0;
}

Expand Down