|
| 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 | +} |
0 commit comments