Skip to content

Commit e194fbc

Browse files
author
Andrey Golovachev (moonzaki)
committed
fix: change path to sprite; issues: vitejs/vite#4454 ; add icon to favicon;
1 parent 0841eda commit e194fbc

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"private": true,
44
"version": "0.0.0",
55
"type": "module",
6-
"home": "https://moonzaki.github.io/notes-app",
6+
"home": "https://moonzaki.github.io/notes-app/",
77
"scripts": {
88
"dev": "vite",
99
"build": "vite build",

src/components/NoteAddButton/NoteAddButton.jsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import NoteButton from '../NoteButton/NoteButton';
22
import './NoteAddButton.scss';
33

4-
function NoteAddButton({clearForm}) {
4+
function NoteAddButton({ clearForm }) {
5+
const baseUrl = import.meta.env.BASE_URL;
56
return (
67
<NoteButton className="note-add" onClick={clearForm}>
78
<svg width="20" height="21" viewBox="0 0 20 21">
8-
<use href="/sprite.svg#add-svg"></use>
9+
<use href={`${baseUrl ? baseUrl + '/' : ''}sprite.svg#add-svg`}></use>
910
</svg>
1011
New memory
1112
</NoteButton>

src/components/NoteForm/NoteForm.jsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function NoteForm({ callback, data, setCurrentItem, delItem }) {
8686
}
8787
};
8888

89-
89+
const baseUrl = import.meta.env.BASE_URL;
9090

9191
return (
9292
<form className={styles['note-form']} onSubmit={addNoteItem}>
@@ -105,13 +105,13 @@ function NoteForm({ callback, data, setCurrentItem, delItem }) {
105105
className={styles.delete}
106106
onClick={() => { delCurrentItem(data); }}>
107107
<svg width="20" height="20" viewBox="0 0 20 20">
108-
<use href='/sprite.svg#delete-svg'></use>
108+
<use href={`${baseUrl ? baseUrl + '/' : ''}sprite.svg#delete-svg`}></use>
109109
</svg>
110110
</Button>}
111111
</div>
112112
<div className={styles['input-wrapper']}>
113113
<svg width="18" height="18" viewBox="0 0 18 18">
114-
<use href="/sprite.svg#date-svg"></use>
114+
<use href={`${baseUrl ? baseUrl + '/' : ''}sprite.svg#date-svg`}></use>
115115
</svg>
116116
<p>Date</p>
117117
<Input
@@ -124,7 +124,7 @@ function NoteForm({ callback, data, setCurrentItem, delItem }) {
124124
</div>
125125
<div className={styles['input-wrapper']}>
126126
<svg width="18" height="18" viewBox="0 0 18 18">
127-
<use href="/sprite.svg#tag-svg"></use>
127+
<use href={`${baseUrl ? baseUrl + '/' : ''}sprite.svg#tag-svg`}></use>
128128
</svg>
129129
<p>Tags</p>
130130
<input

0 commit comments

Comments
 (0)