Skip to content

Commit 2327b72

Browse files
authored
Merge pull request #290 from aaron1604/feat/home-icon
Feat/home icon
2 parents e4d9f22 + c3e3fe5 commit 2327b72

File tree

9 files changed

+39
-9
lines changed

9 files changed

+39
-9
lines changed

client/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ docker run -d --name lowcoder-dev -p 3000:3000 -v "$PWD/stacks:/lowcoder-stacks"
3434
1. Check out source code.
3535
2. Change to client dir in the repository root via cd client.
3636
3. Run yarn to install dependencies: .
37-
4. Start dev server: `API_PROXY_TARGET=http://localhost:3000 yarn start`.
37+
4. Start dev server: `LOWCODER_API_SERVICE_URL=http://localhost:3000 yarn start`.
3838
5. After dev server starts successfully, it will be automatically opened in the default browser.
3939

4040
### Before submitting a pull request

client/packages/lowcoder-cli/client.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ declare var REACT_APP_EDITION: string;
3030
declare var REACT_APP_LANGUAGES: string;
3131
declare var REACT_APP_COMMIT_ID: string;
3232
declare var REACT_APP_API_HOST: string;
33+
declare var LOWCODER_NODE_SERVICE_URL: string;
34+
declare var LOWCODER_SHOW_BRAND: string;
35+
declare var LOWCODER_CUSTOM_LOGO: string;
36+
declare var LOWCODER_CUSTOM_LOGO_SQUARE: string;
3337
declare var REACT_APP_ENV: string;
3438
declare var REACT_APP_BUILD_ID: string;
3539
declare var REACT_APP_LOG_LEVEL: string;

client/packages/lowcoder-dev-utils/buildVars.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,22 @@ export const buildVars = [
1919
name: "REACT_APP_API_HOST",
2020
defaultValue: "",
2121
},
22+
{
23+
name: "LOWCODER_SHOW_BRAND",
24+
defaultValue: 'false',
25+
},
26+
{
27+
name: "LOWCODER_CUSTOM_LOGO",
28+
defaultValue: '',
29+
},
30+
{
31+
name: "LOWCODER_CUSTOM_LOGO_SQUARE",
32+
defaultValue: '',
33+
},
34+
{
35+
name: "LOWCODER_NODE_SERVICE_URL",
36+
defaultValue: "",
37+
},
2238
{
2339
name: "REACT_APP_ENV",
2440
defaultValue: "production",

client/packages/lowcoder/src/app-env.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ declare var REACT_APP_EDITION: string;
3333
declare var REACT_APP_LANGUAGES: string;
3434
declare var REACT_APP_COMMIT_ID: string;
3535
declare var REACT_APP_API_HOST: string;
36+
declare var LOWCODER_NODE_SERVICE_URL: string;
37+
declare var LOWCODER_SHOW_BRAND: string;
38+
declare var LOWCODER_CUSTOM_LOGO: string;
39+
declare var LOWCODER_CUSTOM_LOGO_SQUARE: string;
3640
declare var REACT_APP_ENV: string;
3741
declare var REACT_APP_BUILD_ID: string;
3842
declare var REACT_APP_LOG_LEVEL: string;

client/packages/lowcoder/src/assets/images/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches
22
import { ReactComponent as LogoIcon } from "./logo.svg";
33
import { ReactComponent as LogoWithNameIcon } from "./logo-with-name.svg";
4-
import { ReactComponent as LogoHomeIcon } from "./logo-with-name.svg";
4+
import { ReactComponent as LogoHomeIcon } from "./logo-with-name-home.svg";
55

66
export { default as favicon } from "./favicon.ico";
77

client/packages/lowcoder/src/components/PageSkeleton.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ export default function PageSkeleton(props: IProps) {
8383
{!hideHeader && isHeaderReady && (
8484
<Header
8585
headerStart={
86+
LOWCODER_SHOW_BRAND === 'true' ?
87+
LOWCODER_CUSTOM_LOGO !== "" ? <img src={LOWCODER_CUSTOM_LOGO} alt="logo" /> :<StyledLogoWithName branding={true} /> :
8688
<StyledLogoHome branding={true} />
8789
}
8890
style={{ backgroundColor: brandingConfig?.headerColor, ...props.headStyle }}

client/packages/lowcoder/src/pages/common/header.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import history from "util/history";
3434
import { useApplicationId } from "util/hooks";
3535
import { canManageApp } from "util/permissionUtils";
3636
import ProfileDropdown from "./profileDropdown";
37-
import { Logo, LogoWithName } from "@lowcoder-ee/assets/images";
37+
import { Logo, LogoHome, LogoWithName } from "@lowcoder-ee/assets/images";
3838
import { HeaderStartDropdown } from "./headerStartDropdown";
3939
import { AppPermissionDialog } from "../../components/PermissionDialog/AppPermissionDialog";
4040
import { getBrandingConfig } from "../../redux/selectors/configSelectors";
@@ -287,7 +287,9 @@ export default function Header(props: HeaderProps) {
287287
const headerStart = (
288288
<>
289289
<StyledLink onClick={() => history.push(ALL_APPLICATIONS_URL)}>
290-
<LogoIcon />
290+
{LOWCODER_SHOW_BRAND === 'true' ?
291+
LOWCODER_CUSTOM_LOGO_SQUARE !== "" ? <img src={LOWCODER_CUSTOM_LOGO_SQUARE } height={24} width={24} alt="logo" /> :<LogoIcon /> :
292+
<LogoHome />}
291293
</StyledLink>
292294
{editName ? (
293295
<Wrapper>
@@ -429,7 +431,9 @@ export function AppHeader() {
429431
const brandingConfig = useSelector(getBrandingConfig);
430432
const headerStart = (
431433
<StyledLink onClick={() => history.push(ALL_APPLICATIONS_URL)}>
432-
<LogoWithName branding={!user.orgDev} />
434+
{LOWCODER_SHOW_BRAND === 'true' ?
435+
LOWCODER_CUSTOM_LOGO !== "" ? <img src={LOWCODER_CUSTOM_LOGO} height={28} alt="logo" /> :<LogoWithName branding={!user.orgDev} /> :
436+
<LogoHome />}
433437
</StyledLink>
434438
);
435439
const headerEnd = <HeaderProfile user={user} />;

client/packages/lowcoder/src/util/bottomResUtils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const LargeBottomResIconWrapper = styled(IconWrapper)`
6464
function getBottomResIconInnerByUrl(type: BottomResType, url: string) {
6565
let fullUrl = url;
6666
if (!fullUrl.startsWith("http")) {
67-
fullUrl = `${REACT_APP_API_HOST}/node-service/plugin-icons/${url}`;
67+
fullUrl = `${LOWCODER_NODE_SERVICE_URL !== "" ? LOWCODER_NODE_SERVICE_URL : REACT_APP_API_HOST}/node-service/plugin-icons/${url}`;
6868
}
6969
return <img style={{ width: "100%", height: "100%" }} src={fullUrl} alt="" />;
7070
}

client/packages/lowcoder/vite.config.mts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { globalDepPlugin } from "lowcoder-dev-utils/globalDepPlguin";
1414

1515
dotenv.config();
1616

17-
const apiProxyTarget = process.env.API_PROXY_TARGET;
17+
const apiProxyTarget = process.env.LOWCODER_API_SERVICE_URL;
1818
const nodeServiceApiProxyTarget = process.env.NODE_SERVICE_API_PROXY_TARGET;
1919
const nodeEnv = process.env.NODE_ENV ?? "development";
2020
const edition = process.env.REACT_APP_EDITION;
@@ -27,8 +27,8 @@ const base = ensureLastSlash(process.env.PUBLIC_URL);
2727

2828
if (!apiProxyTarget && isDev) {
2929
console.log();
30-
console.log(chalk.red`API_PROXY_TARGET is required.\n`);
31-
console.log(chalk.cyan`Start with command: API_PROXY_TARGET=\{backend-api-addr\} yarn start`);
30+
console.log(chalk.red`LOWCODER_API_SERVICE_URL is required.\n`);
31+
console.log(chalk.cyan`Start with command: LOWCODER_API_SERVICE_URL=\{backend-api-addr\} yarn start`);
3232
console.log();
3333
process.exit(1);
3434
}

0 commit comments

Comments
 (0)