Skip to content

Commit

Permalink
fix: change path to sprite; issues: vitejs/vite#4454 ; add icon to fa…
Browse files Browse the repository at this point in the history
…vicon;
  • Loading branch information
Andrey Golovachev (moonzaki) committed Nov 10, 2024
1 parent 0841eda commit e194fbc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"version": "0.0.0",
"type": "module",
"home": "https://moonzaki.github.io/notes-app",
"home": "https://moonzaki.github.io/notes-app/",
"scripts": {
"dev": "vite",
"build": "vite build",
Expand Down
5 changes: 3 additions & 2 deletions src/components/NoteAddButton/NoteAddButton.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import NoteButton from '../NoteButton/NoteButton';
import './NoteAddButton.scss';

function NoteAddButton({clearForm}) {
function NoteAddButton({ clearForm }) {
const baseUrl = import.meta.env.BASE_URL;
return (
<NoteButton className="note-add" onClick={clearForm}>
<svg width="20" height="21" viewBox="0 0 20 21">
<use href="/sprite.svg#add-svg"></use>
<use href={`${baseUrl ? baseUrl + '/' : ''}sprite.svg#add-svg`}></use>
</svg>
New memory
</NoteButton>
Expand Down
8 changes: 4 additions & 4 deletions src/components/NoteForm/NoteForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function NoteForm({ callback, data, setCurrentItem, delItem }) {
}
};


const baseUrl = import.meta.env.BASE_URL;

return (
<form className={styles['note-form']} onSubmit={addNoteItem}>
Expand All @@ -105,13 +105,13 @@ function NoteForm({ callback, data, setCurrentItem, delItem }) {
className={styles.delete}
onClick={() => { delCurrentItem(data); }}>
<svg width="20" height="20" viewBox="0 0 20 20">
<use href='/sprite.svg#delete-svg'></use>
<use href={`${baseUrl ? baseUrl + '/' : ''}sprite.svg#delete-svg`}></use>
</svg>
</Button>}
</div>
<div className={styles['input-wrapper']}>
<svg width="18" height="18" viewBox="0 0 18 18">
<use href="/sprite.svg#date-svg"></use>
<use href={`${baseUrl ? baseUrl + '/' : ''}sprite.svg#date-svg`}></use>
</svg>
<p>Date</p>
<Input
Expand All @@ -124,7 +124,7 @@ function NoteForm({ callback, data, setCurrentItem, delItem }) {
</div>
<div className={styles['input-wrapper']}>
<svg width="18" height="18" viewBox="0 0 18 18">
<use href="/sprite.svg#tag-svg"></use>
<use href={`${baseUrl ? baseUrl + '/' : ''}sprite.svg#tag-svg`}></use>
</svg>
<p>Tags</p>
<input
Expand Down

0 comments on commit e194fbc

Please sign in to comment.