feat: Add more pages
This commit is contained in:
25
src/widgets/CreateButton/index.tsx
Normal file
25
src/widgets/CreateButton/index.tsx
Normal file
@ -0,0 +1,25 @@
|
||||
import { Button } from "@mui/material";
|
||||
import { Plus } from "lucide-react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
interface CreateButtonProps {
|
||||
label: string;
|
||||
path: string;
|
||||
}
|
||||
|
||||
export const CreateButton = ({ label, path }: CreateButtonProps) => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<Button
|
||||
variant="contained"
|
||||
color="primary"
|
||||
onClick={() => {
|
||||
navigate(path);
|
||||
}}
|
||||
startIcon={<Plus size={20} />}
|
||||
>
|
||||
{label}
|
||||
</Button>
|
||||
);
|
||||
};
|
@ -9,7 +9,6 @@ type Language = (typeof LANGUAGES)[number];
|
||||
export const LanguageSwitcher = observer(() => {
|
||||
const { language, setLanguage } = languageStore;
|
||||
|
||||
// Memoize getLanguageLabel for consistent rendering
|
||||
const getLanguageLabel = useCallback((lang: Language) => {
|
||||
switch (lang) {
|
||||
case "ru":
|
||||
@ -45,7 +44,7 @@ export const LanguageSwitcher = observer(() => {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="fixed top-1/2 -translate-y-1/2 right-0 flex flex-col gap-2 p-4 z-10 ">
|
||||
<div className="fixed bottom-0 left-1/2 -translate-x-1/2 flex gap-2 p-4 z-10 ">
|
||||
{/* Added some styling for better visualization */}
|
||||
{LANGUAGES.map((lang) => (
|
||||
<Button
|
||||
|
@ -21,7 +21,6 @@ export function MediaViewer({
|
||||
height: "100%",
|
||||
display: "flex",
|
||||
flexGrow: 1,
|
||||
justifyContent: "center",
|
||||
}}
|
||||
className={className}
|
||||
>
|
||||
@ -33,8 +32,8 @@ export function MediaViewer({
|
||||
alt={media?.filename}
|
||||
style={{
|
||||
width: "100%",
|
||||
|
||||
objectFit: "cover",
|
||||
height: "100%",
|
||||
objectFit: "contain",
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
@ -47,7 +46,7 @@ export function MediaViewer({
|
||||
style={{
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
objectFit: "cover",
|
||||
objectFit: "contain",
|
||||
borderRadius: 8,
|
||||
}}
|
||||
controls
|
||||
@ -64,7 +63,7 @@ export function MediaViewer({
|
||||
style={{
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
objectFit: "cover",
|
||||
objectFit: "contain",
|
||||
borderRadius: 8,
|
||||
}}
|
||||
/>
|
||||
@ -78,7 +77,7 @@ export function MediaViewer({
|
||||
style={{
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
objectFit: "cover",
|
||||
objectFit: "contain",
|
||||
borderRadius: 8,
|
||||
}}
|
||||
/>
|
||||
|
34
src/widgets/SnapshotRestore/index.tsx
Normal file
34
src/widgets/SnapshotRestore/index.tsx
Normal file
@ -0,0 +1,34 @@
|
||||
import { Button } from "@mui/material";
|
||||
|
||||
export const SnapshotRestore = ({
|
||||
onDelete,
|
||||
onCancel,
|
||||
open,
|
||||
}: {
|
||||
onDelete: () => void;
|
||||
onCancel: () => void;
|
||||
open: boolean;
|
||||
}) => {
|
||||
return (
|
||||
<div
|
||||
className={`fixed top-0 left-0 w-screen h-screen flex justify-center items-center z-10000 bg-black/30 transition-all duration-300 ${
|
||||
open ? "block" : "hidden"
|
||||
}`}
|
||||
>
|
||||
<div className="bg-white p-4 w-140 rounded-lg flex flex-col gap-4 items-center">
|
||||
<p className="text-black w-110 text-center">
|
||||
Вы уверены, что хотите восстановить этот снапшот?
|
||||
</p>
|
||||
<p className="text-black w-100 text-center">
|
||||
Это действие нельзя будет отменить.
|
||||
</p>
|
||||
<div className="flex gap-4 justify-center">
|
||||
<Button variant="contained" color="primary" onClick={onDelete}>
|
||||
Да
|
||||
</Button>
|
||||
<Button onClick={onCancel}>Нет</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
@ -14,3 +14,5 @@ export * from "./MediaAreaForSight";
|
||||
export * from "./ImageUploadCard";
|
||||
export * from "./LeaveAgree";
|
||||
export * from "./DeleteModal";
|
||||
export * from "./SnapshotRestore";
|
||||
export * from "./CreateButton";
|
||||
|
Reference in New Issue
Block a user