Skip to content

Commit 7d218d6

Browse files
author
FalkWolsky
committed
Small change in Registry and introducing News
1 parent a0565ab commit 7d218d6

File tree

7 files changed

+148
-1
lines changed

7 files changed

+148
-1
lines changed

client/packages/lowcoder-design/src/icons/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ export { ReactComponent as AppsIcon } from "./remix/apps-2-line.svg";
227227
export { ReactComponent as WorkspacesIcon } from "./remix/hotel-line.svg";
228228

229229
export { ReactComponent as HomeIcon } from "./remix/home-3-line.svg";
230+
export { ReactComponent as NewsIcon } from "./remix/megaphone-line.svg";
230231
export { ReactComponent as HomeModuleIcon } from "./remix/focus-mode.svg";
231232
export { ReactComponent as HomeQueryLibraryIcon } from "./remix/braces-line.svg";
232233
export { ReactComponent as HomeDataSourceIcon } from "./remix/database-2-line.svg";

client/packages/lowcoder/src/app.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { default as App } from "antd/es/app";
22
import { default as ConfigProvider } from "antd/es/config-provider";
33
import {
44
USER_PROFILE_URL,
5+
NEWS_URL,
56
ALL_APPLICATIONS_URL,
67
APP_EDITOR_URL,
78
APPLICATION_VIEW_URL,
@@ -153,6 +154,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
153154
fallback="layout"
154155
path={[
155156
USER_PROFILE_URL,
157+
NEWS_URL,
156158
ALL_APPLICATIONS_URL,
157159
DATASOURCE_CREATE_URL,
158160
DATASOURCE_EDIT_URL,

client/packages/lowcoder/src/constants/routesURL.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { DatasourceType } from "@lowcoder-ee/constants/queryConstants";
66
export const BASE_URL = "/";
77
export const USER_AUTH_URL = "/user/auth";
88
export const USER_PROFILE_URL = "/user/profile";
9+
export const NEWS_URL = "/news";
910
export const COMPONENT_DOC_URL = "/components";
1011
export const SETTING = "/setting";
1112
export const PERMISSION_SETTING = "/setting/permission";

client/packages/lowcoder/src/i18n/locales/en.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2797,6 +2797,7 @@ export const en = {
27972797
},
27982798
"home": {
27992799
"profile": "Your Profile",
2800+
"news": "News",
28002801
"allApplications": "Your Apps",
28012802
"allModules": "Your Modules",
28022803
"allFolders": "All Folders",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
import styled from "styled-components";
2+
import { trans } from "../../i18n";
3+
import { useLocation } from "react-router-dom";
4+
import { NEWS_URL } from "constants/routesURL";
5+
import { default as Divider } from "antd/es/divider";
6+
7+
import { Avatar, Badge, Button, Card, Col, Row, Space, Typography, Select, Table, Flex } from "antd";
8+
9+
10+
import {
11+
HomeModuleIcon,
12+
MarketplaceIcon,
13+
AppsIcon,
14+
} from "lowcoder-design";
15+
import { AppView } from "@lowcoder-ee/appView/AppView";
16+
import { useRef } from "react";
17+
18+
const { Text, Title, Link } = Typography;
19+
20+
const Wrapper = styled.div`
21+
display: flex;
22+
flex-direction: column;
23+
width: 100%;
24+
height: 100%;
25+
`;
26+
27+
const HeaderWrapper = styled.div`
28+
height: 84px;
29+
width: 100%;
30+
display: flex;
31+
padding: 0 36px;
32+
align-items: center;
33+
flex-shrink: 0;
34+
@media screen and (max-width: 500px) {
35+
padding: 0 24px;
36+
}
37+
`;
38+
39+
const ContentWrapper = styled.div`
40+
position: relative;
41+
`;
42+
43+
44+
const NewsView = styled.div`
45+
font-size: 14px;
46+
color: #8b8fa3;
47+
flex-grow: 1;
48+
padding-top: 0px;
49+
padding-left: 40px;
50+
max-width: 95%;
51+
`;
52+
53+
const StyleNewsCover = styled.div`
54+
background: rgb(2,0,36);
55+
background: -moz-linear-gradient(31deg, rgba(2,0,36,1) 0%, rgba(121,9,102,1) 35%, rgba(0,212,255,1) 100%);
56+
background: -webkit-linear-gradient(31deg, rgba(2,0,36,1) 0%, rgba(121,9,102,1) 35%, rgba(0,212,255,1) 100%);
57+
background: linear-gradient(31deg, rgba(2,0,36,1) 0%, rgba(121,9,102,1) 35%, rgba(0,212,255,1) 100%);
58+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#020024",endColorstr="#00d4ff",GradientType=1);
59+
padding: 25px;
60+
height: 120px;
61+
border-radius:10px 10px 0 0;
62+
`;
63+
64+
const StyleNewsContent = styled.div`
65+
position: relative;
66+
margin-top:-50px;
67+
display: flex;
68+
align-items: end;
69+
gap: 20px;
70+
71+
.subtitle {
72+
color: #8b8fa3;
73+
}
74+
75+
.button-end {
76+
margin-left: auto;
77+
}
78+
79+
svg {
80+
margin-right: 5px;
81+
vertical-align: middle;
82+
}
83+
`;
84+
85+
const isSelfHost = window.location.host !== 'app.lowcoder.cloud';
86+
var newsLink = "https://app.lowcoder.cloud/apps/6637657e859baf650aebf1b1/view?template=1";
87+
const commitId = REACT_APP_COMMIT_ID;
88+
const buildId = REACT_APP_BUILD_ID;
89+
90+
if (buildId) {
91+
newsLink += `&b=${buildId}`;
92+
}
93+
if (isSelfHost) {
94+
newsLink += `&v=${commitId}`;
95+
}
96+
97+
export function NewsLayout() {
98+
99+
return (
100+
<Wrapper>
101+
<HeaderWrapper>
102+
103+
</HeaderWrapper>
104+
105+
<ContentWrapper>
106+
<NewsView>
107+
<StyleNewsCover>
108+
<h1>Lowcoder {trans("home.news")}</h1>
109+
</StyleNewsCover>
110+
<Card style={{ marginBottom: "20px" }}>
111+
<iframe
112+
style={{ border: "none" }}
113+
title="Lowcoder News"
114+
width="100%"
115+
height="100%"
116+
src={newsLink}
117+
/>
118+
<Divider />
119+
120+
</Card>
121+
122+
</NewsView>
123+
</ContentWrapper>
124+
</Wrapper>
125+
);
126+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { NewsLayout } from "./NewsLayout";
2+
3+
export function NewsView() {
4+
5+
return <NewsLayout/>;
6+
7+
};

client/packages/lowcoder/src/pages/ApplicationV2/index.tsx

+10-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import {
1010
QUERY_LIBRARY_URL,
1111
SETTING,
1212
TRASH_URL,
13-
ADMIN_APP_URL
13+
ADMIN_APP_URL,
14+
NEWS_URL
1415
} from "constants/routesURL";
1516
import { getUser, isFetchingUser } from "redux/selectors/usersSelectors";
1617
import { useDispatch, useSelector } from "react-redux";
@@ -20,6 +21,7 @@ import {
2021
FolderIcon,
2122
HomeDataSourceIcon,
2223
HomeIcon,
24+
NewsIcon,
2325
HomeModuleIcon,
2426
HomeQueryLibraryIcon,
2527
HomeSettingIcon,
@@ -42,6 +44,7 @@ import { ProductLoading } from "components/ProductLoading";
4244
import { Layout } from "../../components/layout/Layout";
4345
import { HomeView } from "./HomeView";
4446
import { UserProfileView } from "./UserProfileView";
47+
import { NewsView } from "./NewsView";
4548
import styled, { css } from "styled-components";
4649
import history from "../../util/history";
4750
import { FolderView } from "./FolderView";
@@ -347,6 +350,12 @@ export default function ApplicationHome() {
347350
routeComp: UserProfileView,
348351
icon: ({ selected, ...otherProps }) => selected ? <UserIcon {...otherProps} width={"24px"}/> : <UserIcon {...otherProps} width={"24px"}/>,
349352
},
353+
{
354+
text: <TabLabel>{trans("home.news")}</TabLabel>,
355+
routePath: NEWS_URL,
356+
routeComp: NewsView,
357+
icon: ({ selected, ...otherProps }) => selected ? <NewsIcon {...otherProps} width={"24px"}/> : <NewsIcon {...otherProps} width={"24px"}/>,
358+
},
350359
{
351360
text: <TabLabel>{trans("home.allApplications")}</TabLabel>,
352361
routePath: ALL_APPLICATIONS_URL,

0 commit comments

Comments
 (0)