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

Remove MUI dependency #25

Closed
wants to merge 4 commits into from
Closed
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
34 changes: 15 additions & 19 deletions popup/src/components/EmptySelection.jsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,34 @@
import React, { useState } from "react";
import { Card, CardActions, Typography } from "@mui/material";
import astronautUfo from "../assets/ufo_ast.png";
import { Button } from "@mantine/core";
import { openAllSnipdPage } from "../utils/snippitUtils";
import "../styles/EmptySelection.css";
import { Button, Group, Image, Stack, Text } from "@mantine/core";

import { NewNote } from "./NewNote";
import { openAllSnipdPage } from "../utils/snippitUtils";
import astronautUfo from "../assets/ufo_ast.png";

export function EmptySelection() {
const [isNewNote, setIsNewNote] = useState(false);

const NoSelect = () => {
return (
<div className="emptySelectionDiv">
<Stack h={"95vh"} align="center" justify="center">
<center>
<img className="astronautUfoImage" src={astronautUfo} alt="Logo" />
<Typography className="margin16" variant="h6">
<b>
To save a snippet, please make a selection. <hr />
It appears that no text/image/link has been selected.
</b>
<br />
</Typography>
<Image w={"100%"} src={astronautUfo} alt="Logo" />
<Text m={16} fw={700} fz={18}>
To save a snippet, please make a selection. <hr />
It appears that no text/image/link has been selected.
</Text>
</center>

<CardActions className="cardActions">
<Button className="margin16" onClick={() => setIsNewNote(true)}>
<Group position="center">
<Button m={16} onClick={() => setIsNewNote(true)}>
Make note
</Button>

<Button className="margin16" onClick={() => openAllSnipdPage()}>
<Button m={16} onClick={() => openAllSnipdPage()}>
Central Page
</Button>
</CardActions>
</div>
</Group>
</Stack>
);
};

Expand Down
23 changes: 7 additions & 16 deletions popup/src/components/NewCategory..jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React, { useState } from "react";
import { TextField, Button, Box } from "@mui/material";
import "../styles/Categories.css";
import { Button, Group, TextInput } from "@mantine/core";

function NewCategory({ addCategory }) {

const [newCategoryName, setNewCategoryName] = useState("");

const handleChange = (event) => {
Expand All @@ -15,25 +13,18 @@ function NewCategory({ addCategory }) {
};

return (
<div className="new-category-div" textAlign="center">
<TextField
className="margin-8"
id="outlined-basic"
label="New Category"
variant="outlined"
<Group position="center">
<TextInput
m={8}
placeholder="New Category Name"
value={newCategoryName}
onChange={handleChange}
/>

<Button
variant="contained"
className="add-category-button"
onClick={handleAddCategory}
disabled={!newCategoryName.trim()} // Disable button if the category name is empty or only contains whitespace
>
<Button m={8} onClick={handleAddCategory} disabled={!newCategoryName.trim()}>
Add
</Button>
</div>
</Group>
);
}

Expand Down
24 changes: 10 additions & 14 deletions popup/src/components/NewNote.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// NewNote.js

import React, { useState } from "react";
import { CardActions, TextField } from "@mui/material";
import { Button } from "@mantine/core";
import { Button, Textarea } from "@mantine/core";

import { saveNote } from "../utils/snippitUtils";
import "../styles/EmptySelection.css";

export function NewNote({ onClose }) {
const [noteContent, setNoteContent] = useState("");
Expand All @@ -17,19 +14,18 @@ export function NewNote({ onClose }) {

return (
<>
<TextField
<Textarea
label="Note content"
variant="outlined"
multiline={true}
rows={8}
minRows={4}
maxRows={10}
autosize
withAsterisk
fullWidth
onChange={(e) => setNoteContent(e.target.value)}
/>
<CardActions className="cardActions">
<Button className="margin16" onClick={handleMakeNote}>
Make note
</Button>
</CardActions>
<Button m={16} onClick={handleMakeNote}>
Make note
</Button>
</>
);
}
14 changes: 0 additions & 14 deletions popup/src/styles/Categories.css

This file was deleted.

25 changes: 0 additions & 25 deletions popup/src/styles/EmptySelection.css

This file was deleted.