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

Change deprecated visible property to open #1000

Merged
merged 1 commit into from
Sep 15, 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
2 changes: 1 addition & 1 deletion src/components/AffixButton/AffixButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const AffixButton = ({ personalitySlug }: AffixButtonProps) => {
</div>
<AletheiaModal
className="ant-modal-content"
visible={isModalVisible}
open={isModalVisible}
footer={false}
onCancel={handleHideModal}
centered
Expand Down
2 changes: 1 addition & 1 deletion src/components/ClaimReview/ClaimReviewDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const ClaimReviewDrawer = () => {

return (
<LargeDrawer
visible={!reviewDrawerCollapsed}
open={!reviewDrawerCollapsed}
onClose={() => dispatch(actions.closeReviewDrawer())}
>
{claim && data_hash && !isLoading ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ const DynamicReviewTaskForm = ({ data_hash, personality, claim }) => {
</Row>

<WarningModal
visible={gobackWarningModal}
open={gobackWarningModal}
title={t("warningModal:title", {
warning: t("warningModal:gobackWarning"),
})}
Expand Down
10 changes: 5 additions & 5 deletions src/components/Form/ClaimReviewSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const SelectInput = styled(Select)`

const ClaimReviewSelect = ({ type, onChange, defaultValue, placeholder }) => {
const { vw } = useAppSelector((state) => state);
const [visible, setVisible] = useState(false);
const [open, setOpen] = useState(false);
const [value, setValue] = useState(defaultValue);

const onChangeSelect = (e) => {
Expand All @@ -57,17 +57,17 @@ const ClaimReviewSelect = ({ type, onChange, defaultValue, placeholder }) => {
}, [value, onChange]);

const handleCloseModal = () => {
setVisible(false);
setOpen(false);
};

const handleOnClick = () => {
if (vw?.sm) {
setVisible(true);
setOpen(true);
}
};

const handleChangeOk = () => {
setVisible(false);
setOpen(false);
};

return (
Expand Down Expand Up @@ -112,7 +112,7 @@ const ClaimReviewSelect = ({ type, onChange, defaultValue, placeholder }) => {
</Option>
</SelectInput>
<ClassificationModal
visible={visible}
open={open}
value={value}
setValue={setValue}
handleOk={handleChangeOk}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Form/ClassificationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ClassificationText from "../ClassificationText";
import { AletheiaModal, ModalCancelButton } from "../Modal/AletheiaModal.style";

const ClassificationModal = ({
visible,
open,
value,
setValue,
handleOk,
Expand All @@ -19,7 +19,7 @@ const ClassificationModal = ({

return (
<AletheiaModal
visible={visible}
open={open}
footer={false}
onCancel={handleCancel}
setValue={setValue}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ImageUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const ImageUpload = ({
</Text>
)}
<AletheiaModal
visible={previewOpen}
open={previewOpen}
title={previewTitle}
footer={null}
onCancel={handleCancel}
Expand Down
4 changes: 2 additions & 2 deletions src/components/LargeDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import colors from "../styles/colors";

const LargeDrawer = ({
children,
visible,
open,
onClose,
backgroundColor = colors.lightGray,
}) => {
const { vw } = useAppSelector((state) => state);
return (
<Drawer
visible={visible}
open={open}
onClose={onClose}
width={vw?.sm ? "100%" : "60%"}
height={vw?.sm ? "85%" : "100%"}
Expand Down
10 changes: 5 additions & 5 deletions src/components/List/SortByButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import colors from "../../styles/colors";

const SortByButton = ({ refreshListItems }) => {
const { t } = useTranslation();
const [visible, setVisible] = useState(false);
const [open, setOpen] = useState(false);
const [value, setValue] = useState("asc");

return (
Expand All @@ -22,7 +22,7 @@ const SortByButton = ({ refreshListItems }) => {
}}
/>
}
onClick={() => setVisible(!visible)}
onClick={() => setOpen(!open)}
style={{
borderWidth: "2px",
borderColor: colors.blackSecondary,
Expand All @@ -46,14 +46,14 @@ const SortByButton = ({ refreshListItems }) => {
</Button>

<OrderModal
visible={visible}
open={open}
value={value}
setValue={setValue}
handleOk={() => {
refreshListItems(value);
setVisible(!visible);
setOpen(!open);
}}
handleCancel={() => setVisible(false)}
handleCancel={() => setOpen(false)}
/>
</>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/Modal/OrderModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import AletheiaButton, { ButtonType } from "../Button";
import OrderRadio from "../Radio/OrderRadio";
import { AletheiaModal, ModalCancelButton } from "./AletheiaModal.style";

const OrderModal = ({ visible, value, setValue, handleOk, handleCancel }) => {
const OrderModal = ({ open, value, setValue, handleOk, handleCancel }) => {
const { t } = useTranslation();

return (
<AletheiaModal
className="ant-modal-content"
visible={visible}
open={open}
footer={false}
onCancel={handleCancel}
title={t("orderModal:title")}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Modal/WarningModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { AletheiaModal, ModalCancelButton } from "./AletheiaModal.style";
import colors from "../../styles/colors";

const WarningModal = ({
visible,
open,
title,
width,
handleOk,
Expand All @@ -20,7 +20,7 @@ const WarningModal = ({
return (
<AletheiaModal
className="ant-modal-content"
visible={visible}
open={open}
footer={footer}
onCancel={handleCancel}
width={width}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const Sidebar = () => {

return (
<Drawer
visible={!menuCollapsed}
open={!menuCollapsed}
onClose={() => dispatch(actions.closeSideMenu())}
width="17rem"
placement="left"
Expand Down
6 changes: 3 additions & 3 deletions src/components/adminArea/Drawer/UserEditDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import DrawerHeader from "./DrawerHeader";
import UserEditForm from "./UserEditForm";

const UserEditDrawer = () => {
const [visible, setVisible] = useAtom(isEditDrawerOpen);
const [open, setOpen] = useAtom(isEditDrawerOpen);
const [currentUser] = useAtom(userBeingEdited);
const [isLoading, setIsLoading] = useState(false);

const onCloseDrawer = () => {
setVisible(false);
setOpen(false);
};

return (
<LargeDrawer visible={visible} onClose={onCloseDrawer}>
<LargeDrawer open={open} onClose={onCloseDrawer}>
<Grid
container
justifyContent="center"
Expand Down
6 changes: 3 additions & 3 deletions src/components/badges/BadgesFormDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const BadgesFormDrawer = () => {
});

const { t } = useTranslation();
const [visible, setVisible] = useAtom(isEditDrawerOpen);
const [open, setOpen] = useAtom(isEditDrawerOpen);
const addBadge = useSetAtom(addBadgeToList);
const finishEditing = useSetAtom(finishEditingItem);
const cancelEditing = useSetAtom(cancelEditingItem);
Expand Down Expand Up @@ -142,7 +142,7 @@ const BadgesFormDrawer = () => {
.then((createdBadge) => {
addBadge(createdBadge);
resetForm();
setVisible(false);
setOpen(false);
})
.catch((err) => {
setIsLoading(false);
Expand All @@ -165,7 +165,7 @@ const BadgesFormDrawer = () => {

return (
<LargeDrawer
visible={visible}
visible={open}
onClose={onCloseDrawer}
backgroundColor={colors.lightGraySecondary}
>
Expand Down
Loading