@edu-tosel/design 1.0.359 → 1.0.364
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,7 +8,7 @@ const formatDate = (date) => {
|
|
|
8
8
|
const day = String(date.getDate()).padStart(2, "0");
|
|
9
9
|
return `${year}.${month}.${day}`;
|
|
10
10
|
};
|
|
11
|
-
export default function News({ newsList }) {
|
|
11
|
+
export default function News({ newsList, url }) {
|
|
12
12
|
// createdAt 기준으로 최신 4개 선택
|
|
13
13
|
const selectedNews = useMemo(() => {
|
|
14
14
|
const sorted = [...newsList]
|
|
@@ -99,8 +99,8 @@ export default function News({ newsList }) {
|
|
|
99
99
|
const rightDateText = {
|
|
100
100
|
textStyles: "text-xs md:text-sm text-gray-600 whitespace-nowrap",
|
|
101
101
|
};
|
|
102
|
-
return (_jsxs("div", { className: cn(container, "font-pretendard-var"), children: [_jsx("div", { className: cn(leftCont), children: _jsx("article", { className: cn(mainArticle), children: _jsx("a", {
|
|
102
|
+
return (_jsxs("div", { className: cn(container, "font-pretendard-var"), children: [_jsx("div", { className: cn(leftCont), children: _jsx("article", { className: cn(mainArticle), children: _jsx("a", { className: "block", onClick: () => window.open(`${url}/${selectedNews.main.id}`), children: _jsxs("div", { className: cn(imgArea), children: [_jsx("div", { className: cn(imgElm), style: { backgroundImage: `url(${selectedNews.main.imgUrl})` } }), _jsxs("div", { className: cn(textElm), children: [_jsx("h3", { className: cn(newsTitle), children: selectedNews.main.title }), selectedNews.main.subTitle && (_jsx("div", { className: cn(newsDesc), children: selectedNews.main.subTitle }))] })] }) }) }) }), _jsx("div", { className: cn(rightCont), children: selectedNews.sub.map((news) => {
|
|
103
103
|
const newsDate = new Date(news.createdAt);
|
|
104
|
-
return (_jsx("div", { className: cn(rightItem), children: _jsxs("a", {
|
|
104
|
+
return (_jsx("div", { className: cn(rightItem), children: _jsxs("a", { className: cn(rightItemLink), onClick: () => window.open(`${url}/${news.id}`), children: [_jsxs("div", { className: cn(textArea), children: [_jsx("h5", { className: cn(rightTitle), children: news.title }), news.subTitle && (_jsx("p", { className: cn(rightDesc), children: news.subTitle }))] }), _jsx("div", { className: cn(rightDateArea), children: _jsx("span", { className: cn(rightDateText), children: formatDate(newsDate) }) })] }) }, news.id));
|
|
105
105
|
}) })] }));
|
|
106
106
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edu-tosel/design",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.364",
|
|
4
4
|
"description": "UI components for International TOSEL Committee",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jsx",
|
|
@@ -44,5 +44,8 @@
|
|
|
44
44
|
"uuid": "^10.0.0",
|
|
45
45
|
"zustand": "^4.5.0"
|
|
46
46
|
},
|
|
47
|
-
"devDependencies": {}
|
|
47
|
+
"devDependencies": {},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
}
|
|
48
51
|
}
|
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.364
|