Skip to content

Commit

Permalink
fix: mobile view
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Jun 19, 2023
1 parent b5ceba7 commit 7504ce9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"tailwindCSS.experimental.classRegex": [
[
"tv\\(([^)]*)\\)",
"[\"'`]([^\"'`]*).*?[\"'`]"
"[\"'`]([^\"'`]*).*?[\"'`]",
// match variants className
]
],
}
2 changes: 1 addition & 1 deletion src/app/notes/Paper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const Paper: Component = ({ children }) => {
className={clsx(
'relative bg-slate-50 dark:bg-zinc-900 md:col-start-1 lg:col-auto',
'-m-4 p-[2rem_1rem] lg:m-0 lg:p-[30px_45px]',
'rounded-[0_6px_6px_0] border border-[#bbb3] shadow-sm dark:shadow-[#333]',
'rounded-[0_6px_6px_0] border-neutral-100 shadow-sm dark:border-neutral-800 dark:shadow-[#333] lg:border',
'note-layout-main',
)}
>
Expand Down
6 changes: 4 additions & 2 deletions src/app/notes/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ const NotePage = memo(({ note }: { note: NoteModel }) => {
>
<header>
<NoteTitle />
<span className="inline-flex items-center text-[13px] text-neutral-content/60">
<FloatPopover TriggerComponent={NoteDateMeta}>{tips}</FloatPopover>
<span className="flex flex-wrap items-center text-[13px] text-neutral-content/60">
<FloatPopover as="span" TriggerComponent={NoteDateMeta}>
{tips}
</FloatPopover>

<ClientOnly>
<NoteMetaBar />
Expand Down
9 changes: 5 additions & 4 deletions src/components/widgets/note/NoteMetaBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { mood2icon, weather2icon } from '~/lib/meta-icon'
const dividerVertical = <DividerVertical className="!mx-2 scale-y-50" />
const dividerVerticalWithKey = () =>
cloneElement(dividerVertical, { key: `divider-${Math.random()}` })
const sectionBlockClassName = 'flex items-center space-x-1 flex-shrink-0'
export const NoteMetaBar = () => {
const note = useNoteData()
if (!note) return null
Expand All @@ -22,7 +23,7 @@ export const NoteMetaBar = () => {
if (note.weather) {
children.push(
dividerVerticalWithKey(),
<span className="inline-flex items-center space-x-1" key="weather">
<span className={sectionBlockClassName} key="weather">
{weather2icon(note.weather)}
<span className="font-medium">{note.weather}</span>
</span>,
Expand All @@ -32,7 +33,7 @@ export const NoteMetaBar = () => {
if (note.mood) {
children.push(
dividerVerticalWithKey(),
<span className="inline-flex items-center space-x-1" key="mood">
<span className={sectionBlockClassName} key="mood">
{mood2icon(note.mood)}
<span className="font-medium">{note.mood}</span>
</span>,
Expand All @@ -42,7 +43,7 @@ export const NoteMetaBar = () => {
if (note.count.read > 0) {
children.push(
dividerVerticalWithKey(),
<span className="inline-flex items-center space-x-1" key="readcount">
<span className={sectionBlockClassName} key="readcount">
<i className="icon-[mingcute--book-6-line]" />
<span className="font-medium">{note.count.read}</span>
</span>,
Expand All @@ -52,7 +53,7 @@ export const NoteMetaBar = () => {
if (note.count.like > 0) {
children.push(
dividerVerticalWithKey(),
<span className="inline-flex items-center space-x-1" key="linkcount">
<span className={sectionBlockClassName} key="linkcount">
<i className="icon-[mingcute--heart-line]" />
<span className="font-medium">{note.count.like}</span>
</span>,
Expand Down
6 changes: 2 additions & 4 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
REQUEST_QUERY,
} from './constants/system'

let lastGeo = ``
const lastGeo = ``

export default async function middleware(req: NextRequest) {
const { pathname, search } = req.nextUrl
Expand Down Expand Up @@ -40,9 +40,7 @@ export default async function middleware(req: NextRequest) {
const countryInfo = countries.find((x) => x.cca2 === country)
if (countryInfo) {
const flag = countryInfo.flag
requestHeaders.set(REQUEST_GEO, lastGeo)
lastGeo = `${country}-${city}-${flag}`
// getQueryClient().setQueryData(GEO_QUERY_KEY, { country, city, flag })
requestHeaders.set(REQUEST_GEO, `${country}-${city}-${flag}`)
}
}

Expand Down

1 comment on commit 7504ce9

@vercel
Copy link

@vercel vercel bot commented on 7504ce9 Jun 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

springtide – ./

springtide.vercel.app
springtide-innei.vercel.app
springtide-git-main-innei.vercel.app

Please sign in to comment.