generated from EasyWebApp/WebCell-scaffold
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[add] i18n switch, LarkImage component [polish] project, member detail pages
- Loading branch information
Showing
18 changed files
with
300 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { TableCellValue } from 'mobx-lark'; | ||
import { ImageProps } from 'next/image'; | ||
import { FC } from 'react'; | ||
|
||
import { blobURLOf } from '../models/Base'; | ||
import { DefaultImage, fileURLOf } from '../pages/api/Lark/file/[id]'; | ||
|
||
export interface LarkImageProps extends Omit<ImageProps, 'src'> { | ||
src?: TableCellValue; | ||
} | ||
|
||
export const LarkImage: FC<LarkImageProps> = ({ className = '', src = '', alt, ...props }) => ( | ||
<img | ||
className={className} | ||
loading="lazy" | ||
{...props} | ||
src={blobURLOf(src)} | ||
alt={alt} | ||
onError={({ currentTarget: image }) => { | ||
const path = fileURLOf(src); | ||
|
||
if (alt || !path) return; | ||
|
||
const errorURL = decodeURI(image.src); | ||
|
||
image.src = errorURL.endsWith(path) | ||
? errorURL.endsWith(DefaultImage) | ||
? '' | ||
: DefaultImage | ||
: path; | ||
}} | ||
/> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,27 @@ | ||
export const Footer = () => ( | ||
<div className="container mx-auto flex max-w-screen-xl py-12 text-center">idea2app</div> | ||
<div className="container mx-auto flex max-w-screen-xl items-center justify-between border-t-2 px-4 py-12 text-center"> | ||
© 2024 idea2app | ||
<ul className="flex gap-4"> | ||
<li> | ||
<a | ||
className="border-b-2 border-b-black py-1 dark:border-b-white" | ||
href="https://web-cell.dev/" | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
Web Cell | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
className="border-b-2 border-b-black py-1 dark:border-b-white" | ||
href="https://tech-query.me/" | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
Tech Query | ||
</a> | ||
</li> | ||
</ul> | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { DataObject, Filter, ListModel } from 'mobx-restful'; | ||
import { FC, ReactNode } from 'react'; | ||
|
||
import { i18n } from '../../models/Translation'; | ||
import { PageHead } from '../PageHead'; | ||
import { ScrollList } from '../ScrollList'; | ||
|
||
export interface FrameProps<D extends DataObject, F extends Filter<D> = Filter<D>> { | ||
store: ListModel<D, F>; | ||
filter?: F; | ||
defaultData?: D[]; | ||
title: string; | ||
header: string; | ||
className?: string; | ||
scrollList?: boolean; | ||
children?: ReactNode; | ||
Layout: FC<{ defaultData: D[]; className?: string }>; | ||
} | ||
|
||
/** | ||
* @todo remove ScrollList and use children instead? | ||
*/ | ||
export const Frame = <D extends DataObject, F extends Filter<D> = Filter<D>>({ | ||
className = '', | ||
scrollList = true, | ||
children, | ||
title, | ||
header, | ||
Layout, | ||
...rest | ||
}: FrameProps<D, F>) => ( | ||
<div className={`container mx-auto max-w-screen-xl px-4 pb-6 pt-16 ${className}`}> | ||
<PageHead title={title} /> | ||
<h1 className="my-8 text-4xl">{header}</h1> | ||
|
||
{scrollList ? ( | ||
<ScrollList | ||
translator={i18n} | ||
renderList={allItems => <Layout defaultData={allItems} />} | ||
{...rest} | ||
/> | ||
) : ( | ||
children | ||
)} | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
9e53794
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for idea2app ready!
✅ Preview
https://idea2app-5qn25x8we-techquerys-projects.vercel.app
Built with commit 9e53794.
This pull request is being automatically deployed with vercel-action