Skip to content

Commit

Permalink
feat(web): add github link (#872)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeezQ authored Mar 8, 2023
1 parent 3b015d3 commit 82b963d
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 14 deletions.
5 changes: 3 additions & 2 deletions web/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,5 +279,6 @@
},
"Price": {
"Free": "Free"
}
}
},
"star-us-on-github": "Star us on GitHub"
}
5 changes: 3 additions & 2 deletions web/public/locales/zh-CN/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,5 +279,6 @@
},
"Price": {
"Free": "免费"
}
}
},
"star-us-on-github": "在 GitHub 上支持我们"
}
5 changes: 3 additions & 2 deletions web/public/locales/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,5 +279,6 @@
},
"Price": {
"Free": "免费"
}
}
},
"star-us-on-github": "在 GitHub 上支持我们"
}
29 changes: 22 additions & 7 deletions web/src/layouts/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,41 @@
* laf website header nav
***************************/

import { useTranslation } from "react-i18next";
import { FiGithub } from "react-icons/fi";

import UserSetting from "./UserSetting";

import useGlobalStore from "@/pages/globalStore";

export default function Header(props: { size: "sm" | "lg" }) {
const { userInfo } = useGlobalStore((state) => state);
const { t } = useTranslation();

return (
<div className="flex justify-between px-10 py-4 h-[60px]">
<div className="flex items-center">
<img src="/logo.png" alt="logo" width={30} />
<img src="/logo.png" alt="logo" width={30} className="mr-4" />
<a
href="https://github.com/labring/laf"
className="flex items-center ml-2 p-2 py-1 text-base text-gray-700 hover:text-black bg-white rounded-md"
target={"_blank"}
rel="noreferrer"
>
<FiGithub />
<span className="ml-1">{t("star-us-on-github")}</span>
</a>
</div>

<div>
<div className="flex items-center">
{userInfo?.profile ? (
<UserSetting
name={userInfo?.profile?.name}
avatar={userInfo?.profile?.avatar}
width={"30px"}
/>
<>
<UserSetting
name={userInfo?.profile?.name}
avatar={userInfo?.profile?.avatar}
width={"24px"}
/>
</>
) : null}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ function CreateBucketModal(props: { storage?: TBucket; children: React.ReactElem
policy: values.policy,
});
if (!res.error) {
store.setCurrentStorage(res.data);
showSuccess("create success.");
onClose();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function BundleItem(props: {
const { bundle, isActive, onChange } = props;
return (
<div
onClick={() => onChange(bundle.name)}
onClick={() => onChange(bundle.id)}
key={bundle.name}
className={clsx("min-w-[170px] border p-2 rounded-md cursor-pointer", {
"border-primary-500 bg-primary-100": isActive,
Expand Down

0 comments on commit 82b963d

Please sign in to comment.