Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(web): add github link #872

Merged
merged 1 commit into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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