Skip to content

Commit

Permalink
Feat-update-blocked-styles (#373)
Browse files Browse the repository at this point in the history
* tenant block list

* update blocked styles
  • Loading branch information
NewFuture authored Jun 30, 2024
1 parent 7ff919d commit 3674c28
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion client-config-app/src/components/ImageList/ImageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const ImageList: React.FC<ImageListProps> = ({
onDragOver={dragOverHandler}
>
{enableUpload && (
<UploadButton className={styles.item} onUploadChangeHandler={uploadHandler} disbaled={!enable} />
<UploadButton className={styles.item} onUploadChangeHandler={uploadHandler} disabled={!enable} />
)}
{files?.map((item: File, index) => (
<UploadImageItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ export const useUploadButtonStyles = makeStyles({
order: -999999,
},
icon: {
cursor: "pointer",
width: "100%",
height: "100%",
},
iconDisabled: {
cursor: "not-allowed",
},
iconEnabled: {
cursor: "pointer",
color: tokens.colorNeutralForeground2,
...shorthands.transition("scale", "0.3s"),
":hover": {
Expand Down
12 changes: 7 additions & 5 deletions client-config-app/src/components/UploadButton/UploadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { TransKeys } from "../../locales";

export interface UploadButtonProps {
onUploadChangeHandler: (file: File[]) => void;
disbaled?: boolean;
disabled?: boolean;
className?: string;
}

Expand All @@ -16,19 +16,21 @@ export interface UploadButtonProps {
* @returns
*/
export function UploadButton({ disbaled, onUploadChangeHandler, className }: UploadButtonProps) {
export function UploadButton({ disabled, onUploadChangeHandler, className }: UploadButtonProps) {
const styles = useUploadButtonStyles();
const { t } = useTranslation();
return (
<div className={mergeClasses(styles.root, className)}>
<Tooltip content={t(TransKeys.uploadTips)} relationship="label">
<Tooltip content={t(disabled ? TransKeys.uploadDisabled : TransKeys.uploadTips)} relationship="label">
<label htmlFor="image-upload">
<AddRegular className={styles.icon} />
<AddRegular
className={mergeClasses(styles.icon, disabled ? styles.iconDisabled : styles.iconEnabled)}
/>
</label>
</Tooltip>
<input
hidden
disabled={disbaled}
disabled={disabled}
type="file"
id="image-upload"
onChange={(e) => onUploadChangeHandler(Array.from(e.target.files!))}
Expand Down
2 changes: 1 addition & 1 deletion client-config-app/src/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"UploadBlockedTenants": ["698b0e46-51c0-4d3b-a023-16f2b23b8c1e", "72f988bf-86f1-41af-91ab-2d7cd011db47"]
"UploadBlockedTenants": ["698b0e46-51c0-4d3b-a023-16f2b23b8c1e"]
}
1 change: 1 addition & 0 deletions client-config-app/src/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"feedback": "Feedback",
"uploadTips": "Pick pictures or Drag and drop them",
"uploadDisabled": "Upload is blocked",
"delete": "Delete",
"loading": "Loading...",
"radio": "stickers scope",
Expand Down
1 change: 1 addition & 0 deletions client-config-app/src/locales/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export const enum TransKeys {
// termsTitle = "termsTitle",
// feedback = "feedback",
uploadTips = "uploadTips",
uploadDisabled = "uploadDisabled",
delete = "delete",
title = "title",
radio = "radio",
Expand Down
1 change: 1 addition & 0 deletions client-config-app/src/locales/zh-cn.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"feedback": "反馈",
"uploadTips": "选择图片或拖拽至此",
"uploadDisabled": "不可上传",
"delete": "删除",
"loading": "加载中...",
"title_user": "我所收藏的表情包",
Expand Down

0 comments on commit 3674c28

Please sign in to comment.