Commit 4ea2d03a authored by taiyi's avatar taiyi 👀
Browse files

feat: update

parent db646ec6
sha256:dd6d3f78cc2999b5f63024254a368320c59c86ed6d4d71677ad0625f3284c707
\ No newline at end of file
sha256:67ae212c7426aa9e1661a13fb9cdc8ce9dfdf97529d5bf4f9958b6b3da53e84f
\ No newline at end of file
sha256:dd6d3f78cc2999b5f63024254a368320c59c86ed6d4d71677ad0625f3284c707
\ No newline at end of file
sha256:67ae212c7426aa9e1661a13fb9cdc8ce9dfdf97529d5bf4f9958b6b3da53e84f
\ No newline at end of file
......@@ -3,10 +3,10 @@
"frontend": "dockerfile.v0",
"attrs": {
"filename": "Dockerfile",
"label:org.opencontainers.image.created": "2023-05-31T13:36:19.248Z",
"label:org.opencontainers.image.created": "2023-06-05T08:32:39.259Z",
"label:org.opencontainers.image.description": "",
"label:org.opencontainers.image.licenses": "",
"label:org.opencontainers.image.revision": "108b2806d81dfcd8eb8d53229fbd32b361276f4b",
"label:org.opencontainers.image.revision": "db646ec6467e4b680c65ca8160b1ef26377ed8aa",
"label:org.opencontainers.image.source": "",
"label:org.opencontainers.image.title": "",
"label:org.opencontainers.image.url": "",
......@@ -16,10 +16,10 @@
{
"type": "docker-image",
"ref": "docker.io/library/node:18-alpine",
"pin": "sha256:1ccc70acda680aa4ba47f53e7c40b2d4d6892de74817128e0662d32647dd7f4d"
"pin": "sha256:f41850f74ff16a33daff988e2ea06ef8f5daeb6fb84913c7df09552a98caba09"
}
]
},
"containerimage.config.digest": "sha256:dd6d3f78cc2999b5f63024254a368320c59c86ed6d4d71677ad0625f3284c707",
"containerimage.digest": "sha256:dd6d3f78cc2999b5f63024254a368320c59c86ed6d4d71677ad0625f3284c707"
"containerimage.config.digest": "sha256:67ae212c7426aa9e1661a13fb9cdc8ce9dfdf97529d5bf4f9958b6b3da53e84f",
"containerimage.digest": "sha256:67ae212c7426aa9e1661a13fb9cdc8ce9dfdf97529d5bf4f9958b6b3da53e84f"
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ import React from 'react';
import { styled } from '@linaria/react';
import { SectionAside, Readmore } from '@fe-cnyes/fe-common-ui';
// import News24h from './News24h/News24h';
const Container = styled.div`
width: 334px;
......@@ -12,31 +13,34 @@ const Container = styled.div`
const ListAside = () => {
return (
<Container>
<SectionAside
title="主編精選"
icon="/assets/icons/editorChoose.svg"
RightContent={<Readmore />}
/>
{/* 主編精選 */}
{/* https://github.com/vercel/next.js/issues/42292 之後typescript更新上去可拿掉 */}
{/* <News24h /> */}
{/* 人氣排行 */}
<SectionAside
title="人氣排行"
icon="/assets/icons/popularRank.svg"
RightContent={<Readmore />}
/>
{/* 熱門話題 */}
<SectionAside
title="熱門話題"
icon="/assets/icons/hotTopic.svg"
RightContent={<Readmore />}
/>
{/* 主編精選 */}
<SectionAside
title="議題新聞"
icon="/assets/icons/issueNews.svg"
RightContent={<Readmore />}
/>
{/* 專題報導 */}
<SectionAside
title="專題報導"
icon="/assets/icons/topicNews.svg"
RightContent={<Readmore />}
/>
{/* 鉅亨服務 */}
<SectionAside title="鉅亨服務" icon="/assets/icons/anueService.svg" />
</Container>
);
......
import React from 'react';
import { List } from '@fe-cnyes/fe-common-ui';
import { styled } from '@linaria/react';
import { GETNewsOfMultipleCategory } from 'apps/fe-news/api/news';
import { SectionAside, Readmore } from '@fe-cnyes/fe-common-ui';
import { formatTime } from '@fe-cnyes/fe-common-utils';
import Link from 'next/link';
const Container = styled.div`
margin-bottom: 24px;
font-size: 14px;
`;
const News24h = async () => {
const data = await GETNewsOfMultipleCategory({
categories: 'news24h',
limit: 5,
});
const news = data?.data?.items?.data;
return (
<Container>
<SectionAside
title="主編精選"
icon="/assets/icons/editorChoose.svg"
RightContent={<Readmore />}
/>
{news?.map((item: News) => {
const { newsId, publishAt, title, coverSrc } = item;
const src = coverSrc?.s?.src;
const time = formatTime(publishAt, 'HHMM') || '--';
const url = `/news/id/${newsId}`;
return (
<Link key={newsId} href={url}>
<List.News
newsId={newsId}
publishAt={time}
title={title}
coverSrc={src}
fontSize={14}
/>
</Link>
);
})}
</Container>
);
};
export default News24h;
......@@ -26,14 +26,13 @@
"production": {}
}
},
"serve": {
"dev": {
"executor": "@nx/next:server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "fe-news:build",
"dev": true,
"port": 3000,
"hostname": "0.0.0.0"
"port": 3000
},
"configurations": {
"development": {
......
......@@ -61,7 +61,7 @@
}
}
},
"storybook": {
"dev": {
"executor": "@nx/storybook:storybook",
"options": {
"port": 4400,
......
......@@ -14,17 +14,17 @@ const footerLinks = {
{
title: '意見與回饋',
name: 'feedback',
onClick: (e: any) => {
e.preventDefault();
// onClick: (e: any) => {
// e.preventDefault();
if (typeof window !== 'undefined') {
const formURI =
'https://docs.google.com/forms/d/e/1FAIpQLSepnhnP4FgnRXiqezmVme7YX7xqXhxPsd57qbaJ09yJbxTt0g/viewform' +
`?usp=pp_url&entry.364853985=${document.location.href}`;
// if (typeof window !== 'undefined') {
// const formURI =
// 'https://docs.google.com/forms/d/e/1FAIpQLSepnhnP4FgnRXiqezmVme7YX7xqXhxPsd57qbaJ09yJbxTt0g/viewform' +
// `?usp=pp_url&entry.364853985=${document.location.href}`;
window.open(formURI, '_blank');
}
},
// window.open(formURI, '_blank');
// }
// },
},
],
desktopNavs: [
......
import React from 'react';
/* eslint-disable import/no-extraneous-dependencies */
import { styled } from '@linaria/react';
type NewsThemeProps = {
......@@ -7,30 +7,22 @@ type NewsThemeProps = {
coverSrc?: string;
publishAt: number | string;
target?: '_self' | '_blank';
fontSize?: number;
};
const ListContainerBase = styled.li`
list-style: none;
border-bottom: 1px solid #e2e8f1;
font-size: 16px;
line-height: 1.75;
letter-spacing: 0.5px;
color: #383838;
line-height: 28px;
padding: 8px 0;
width: 377px;
width: 100%;
word-wrap: break-word;
display: flex;
a {
div {
flex: 1;
text-decoration: none;
color: #383838;
p {
margin: 0 0 4px 0;
}
time {
font-size: 12px;
color: #909090;
......@@ -58,19 +50,33 @@ const ListContainerBase = styled.li`
}
`;
const Title = styled.p<{ fontSize?: number }>`
font-size: ${({ fontSize }) => `${fontSize}px` || '24px'};
line-height: 1.75;
letter-spacing: 0.5px;
color: #383838;
line-height: 28px;
margin: 0 0 4px 0;
text-align: left;
:hover {
color: #e03f19;
}
`;
const NewsTheme = ({
title,
newsId,
coverSrc,
publishAt,
target,
fontSize,
}: NewsThemeProps) => {
return (
<ListContainerBase key={newsId}>
<a href={`/news/id/${newsId}`} target={target}>
<p>{title}</p>
<div>
<Title fontSize={fontSize}>{title}</Title>
<time>{publishAt}</time>
</a>
</div>
{coverSrc && (
<img alt="news cover" src={coverSrc} width={60} height={60} />
)}
......
......@@ -11,7 +11,7 @@ const Title = styled.h3`
letter-spacing: 0.92px;
padding-left: 21px;
position: relative;
margin: 24px 0;
margin-bottom: 24px;
line-height: 22px;
::before {
......@@ -26,7 +26,7 @@ const Title = styled.h3`
`;
export const Section = ({ title }: SectionProps) => {
return <Title>{title}</Title>;
return <Title key={title}>{title}</Title>;
};
export default Section;
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment