chore: update logo format to png (#830)

This commit is contained in:
boojack 2022-12-23 00:21:53 +08:00 committed by GitHub
parent 7efa749c66
commit 9f25badde3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 22 additions and 22 deletions

View file

@ -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.
@ -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",

View file

@ -48,7 +48,7 @@ func (s *Server) registerSystemRoutes(g *echo.Group) {
AdditionalScript: "",
CustomizedProfile: api.CustomizedProfile{
Name: "memos",
IconURL: "",
LogoURL: "",
Description: "",
Locale: "en",
Appearance: "system",
@ -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),

View file

@ -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" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

BIN
web/public/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

View file

@ -4,8 +4,8 @@
"description": "usememos/memos",
"icons": [
{
"src": "/logo.webp",
"type": "image/webp",
"src": "/logo.png",
"type": "image/png",
"sizes": "520x520"
}
],

View file

@ -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(() => {

View file

@ -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}>

View file

@ -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>

View file

@ -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">

View file

@ -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,
};
});
};
@ -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;
}
@ -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>

View file

@ -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>

View file

@ -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">

View file

@ -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">

View file

@ -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",

View file

@ -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",

View file

@ -5,7 +5,7 @@ interface Profile {
interface CustomizedProfile {
name: string;
iconUrl: string;
logoUrl: string;
description: string;
locale: Locale;
appearance: Appearance;