Skip to content

Commit

Permalink
chore: update logo format to png (#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack committed Dec 22, 2022
1 parent 7efa749 commit 9f25bad
Show file tree
Hide file tree
Showing 18 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions api/system_setting.go
Expand Up @@ -24,8 +24,8 @@ const (
type CustomizedProfile struct {
// Name is the server name, default is `memos`
Name string `json:"name"`
// IconURL is the url of icon image.
IconURL string `json:"iconUrl"`
// LogoURL is the url of logo image.
LogoURL string `json:"logoUrl"`
// Description is the server description.
Description string `json:"description"`
// Locale is the server default locale.
Expand Down Expand Up @@ -100,7 +100,7 @@ func (upsert SystemSettingUpsert) Validate() error {
} else if upsert.Name == SystemSettingCustomizedProfileName {
customizedProfile := CustomizedProfile{
Name: "memos",
IconURL: "",
LogoURL: "",
Description: "",
Locale: "en",
Appearance: "system",
Expand Down
4 changes: 2 additions & 2 deletions server/system.go
Expand Up @@ -48,7 +48,7 @@ func (s *Server) registerSystemRoutes(g *echo.Group) {
AdditionalScript: "",
CustomizedProfile: api.CustomizedProfile{
Name: "memos",
IconURL: "",
LogoURL: "",
Description: "",
Locale: "en",
Appearance: "system",
Expand Down Expand Up @@ -77,7 +77,7 @@ func (s *Server) registerSystemRoutes(g *echo.Group) {
valueMap := value.(map[string]interface{})
systemStatus.CustomizedProfile = api.CustomizedProfile{
Name: valueMap["name"].(string),
IconURL: valueMap["iconUrl"].(string),
LogoURL: valueMap["logoUrl"].(string),
Description: valueMap["description"].(string),
Locale: valueMap["locale"].(string),
Appearance: valueMap["appearance"].(string),
Expand Down
2 changes: 1 addition & 1 deletion web/index.html
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/logo.webp" type="image/*" />
<link rel="icon" href="/logo.png" type="image/*" />
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#f4f4f5" />
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#27272a" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
Expand Down
Binary file removed web/public/logo-full.webp
Binary file not shown.
Binary file added web/public/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed web/public/logo.webp
Binary file not shown.
4 changes: 2 additions & 2 deletions web/public/manifest.json
Expand Up @@ -4,8 +4,8 @@
"description": "usememos/memos",
"icons": [
{
"src": "/logo.webp",
"type": "image/webp",
"src": "/logo.png",
"type": "image/png",
"sizes": "520x520"
}
],
Expand Down
2 changes: 1 addition & 1 deletion web/src/App.tsx
Expand Up @@ -59,7 +59,7 @@ const App = () => {
// dynamic update metadata with customized profile.
document.title = systemStatus.customizedProfile.name;
const link = document.querySelector("link[rel~='icon']") as HTMLLinkElement;
link.href = systemStatus.customizedProfile.iconUrl || "/logo.webp";
link.href = systemStatus.customizedProfile.logoUrl || "/logo.png";
}, [systemStatus]);

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/AboutSiteDialog.tsx
Expand Up @@ -20,7 +20,7 @@ const AboutSiteDialog: React.FC<Props> = ({ destroy }: Props) => {
<>
<div className="dialog-header-container">
<p className="title-text flex items-center">
<img className="w-7 h-auto mr-1" src="/logo.webp" alt="" />
<img className="w-7 h-auto mr-1" src="/logo.png" alt="" />
{t("common.about")} memos
</p>
<button className="btn close-btn" onClick={handleCloseBtnClick}>
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/MemoEditor.tsx
Expand Up @@ -551,7 +551,7 @@ const MemoEditor = () => {
</button>
<button className="action-btn confirm-btn" disabled={!allowSave || state.isUploadingResource} onClick={handleSaveBtnClick}>
{t("editor.save")}
<img className="icon-img w-4 h-auto" src="/logo.webp" />
<img className="icon-img w-4 h-auto" src="/logo.png" />
</button>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/ShareMemoDialog.tsx
Expand Up @@ -147,7 +147,7 @@ const ShareMemoDialog: React.FC<Props> = (props: Props) => {
{state.memoAmount} MEMOS / {createdDays} DAYS
</span>
</div>
<img className="logo-img" src="/logo.webp" alt="" />
<img className="logo-img" src="/logo.png" alt="" />
</div>
</div>
<div className="px-4 py-3 w-full flex flex-row justify-between items-center">
Expand Down
8 changes: 4 additions & 4 deletions web/src/components/UpdateCustomizedProfileDialog.tsx
Expand Up @@ -32,11 +32,11 @@ const UpdateCustomizedProfileDialog: React.FC<Props> = ({ destroy }: Props) => {
});
};

const handleIconUrlChanged = (e: React.ChangeEvent<HTMLInputElement>) => {
const handleLogoUrlChanged = (e: React.ChangeEvent<HTMLInputElement>) => {
setState((state) => {
return {
...state,
iconUrl: e.target.value as string,
logoUrl: e.target.value as string,
};
});
};
Expand Down Expand Up @@ -69,7 +69,7 @@ const UpdateCustomizedProfileDialog: React.FC<Props> = ({ destroy }: Props) => {
};

const handleSaveBtnClick = async () => {
if (state.name === "" || state.iconUrl === "") {
if (state.name === "" || state.logoUrl === "") {
toastHelper.error(t("message.fill-all"));
return;
}
Expand Down Expand Up @@ -103,7 +103,7 @@ const UpdateCustomizedProfileDialog: React.FC<Props> = ({ destroy }: Props) => {
</p>
<input type="text" className="input-text" value={state.name} onChange={handleNameChanged} />
<p className="text-sm mb-1 mt-2">{t("setting.system-section.customize-server.icon-url")}</p>
<input type="text" className="input-text" value={state.iconUrl} onChange={handleIconUrlChanged} />
<input type="text" className="input-text" value={state.logoUrl} onChange={handleLogoUrlChanged} />
<p className="text-sm mb-1 mt-2">Description</p>
<input type="text" className="input-text" value={state.description} onChange={handleDescriptionChanged} />
<p className="text-sm mb-1 mt-2">Server locale</p>
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/Auth.tsx
Expand Up @@ -123,7 +123,7 @@ const Auth = () => {
<div className="auth-form-wrapper">
<div className="page-header-container">
<div className="title-container">
<img className="logo-img" src={systemStatus.customizedProfile.iconUrl} alt="" />
<img className="logo-img" src={systemStatus.customizedProfile.logoUrl} alt="" />
<p className="logo-text">{systemStatus.customizedProfile.name}</p>
</div>
<p className="slogan-text">{systemStatus.customizedProfile.description || t("slogan")}</p>
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/Explore.tsx
Expand Up @@ -63,7 +63,7 @@ const Explore = () => {
<div className="page-container">
<div className="page-header">
<div className="title-container">
<img className="logo-img" src={customizedProfile.iconUrl} alt="" />
<img className="logo-img" src={customizedProfile.logoUrl} alt="" />
<span className="title-text">{customizedProfile.name}</span>
</div>
<div className="action-button-container">
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/MemoDetail.tsx
Expand Up @@ -54,7 +54,7 @@ const MemoDetail = () => {
<div className="page-container">
<div className="page-header">
<div className="title-container">
<img className="logo-img" src={customizedProfile.iconUrl} alt="" />
<img className="logo-img" src={customizedProfile.logoUrl} alt="" />
<p className="logo-text">{customizedProfile.name}</p>
</div>
<div className="action-button-container">
Expand Down
2 changes: 1 addition & 1 deletion web/src/store/module/global.ts
Expand Up @@ -13,7 +13,7 @@ export const initialGlobalState = async () => {
additionalScript: "",
customizedProfile: {
name: "memos",
iconUrl: "https://usememos.com/logo.webp",
logoUrl: "/logo.png",
description: "",
locale: "en",
appearance: "system",
Expand Down
2 changes: 1 addition & 1 deletion web/src/store/reducer/global.ts
Expand Up @@ -23,7 +23,7 @@ const globalSlice = createSlice({
additionalScript: "",
customizedProfile: {
name: "memos",
iconUrl: "https://usememos.com/logo.webp",
logoUrl: "/logo.png",
description: "",
locale: "en",
appearance: "system",
Expand Down
2 changes: 1 addition & 1 deletion web/src/types/modules/system.d.ts
Expand Up @@ -5,7 +5,7 @@ interface Profile {

interface CustomizedProfile {
name: string;
iconUrl: string;
logoUrl: string;
description: string;
locale: Locale;
appearance: Appearance;
Expand Down

0 comments on commit 9f25bad

Please sign in to comment.