Skip to content

Commit 67f604c

Browse files
committed
remove toast and make css edits
1 parent 0fbd8d4 commit 67f604c

File tree

3 files changed

+8
-31
lines changed

3 files changed

+8
-31
lines changed

src/components/CopyMarkdown.js

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ function CopyMarkdown() {
5050
}, 2000);
5151
} catch (error) {
5252
console.error('Failed to copy markdown:', error);
53-
showToast('Failed to copy. Please try again.', true);
5453
}
5554
}, []);
5655

@@ -75,7 +74,6 @@ function CopyMarkdown() {
7574
setIsOpen(false);
7675
} catch (error) {
7776
console.error('Failed to view markdown:', error);
78-
showToast('Failed to open view. Please try again.', true);
7977
}
8078
}, []);
8179

@@ -109,30 +107,9 @@ function CopyMarkdown() {
109107
setIsOpen(false);
110108
} catch (error) {
111109
console.error('Failed to open ChatGPT:', error);
112-
showToast('Failed to open ChatGPT. Please try again.', true);
113110
}
114111
}, []);
115112

116-
// Show toast notification
117-
const showToast = (message, isError = false) => {
118-
const toast = document.createElement('div');
119-
toast.className = styles.toast;
120-
if (isError) {
121-
toast.classList.add(styles.errorToast);
122-
}
123-
toast.textContent = message;
124-
document.body.appendChild(toast);
125-
126-
setTimeout(() => {
127-
toast.style.opacity = '0';
128-
setTimeout(() => {
129-
if (document.body.contains(toast)) {
130-
document.body.removeChild(toast);
131-
}
132-
}, 500);
133-
}, 3000);
134-
};
135-
136113
// Handle click outside to close dropdown
137114
const handleClickOutside = useCallback((event) => {
138115
// Only close if clicking outside both the button and dropdown
@@ -229,7 +206,7 @@ function CopyMarkdown() {
229206
onClick={copyMarkdown}
230207
role="menuitem"
231208
>
232-
<span>Copy page as Markdown</span>
209+
<span>Copy page as plain text</span>
233210
</button>
234211
</li>
235212
<li className={styles.item}>
@@ -247,7 +224,7 @@ function CopyMarkdown() {
247224
onClick={openInChatGpt}
248225
role="menuitem"
249226
>
250-
<span>Open in ChatGPT</span>
227+
<span>Open page in ChatGPT</span>
251228
</button>
252229
</li>
253230
</ul>

src/components/CopyMarkdown.module.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313

1414
.buttonText {
1515
font-size: 1rem;
16-
font-weight: 600;
16+
font-weight: 500;
1717
}
1818

1919
.button {
2020
display: flex;
2121
align-items: center;
2222
gap: 0.2rem;
2323
font-size: 1rem;
24-
font-weight: 600;
24+
font-weight: 500;
2525
color: var(--ifm-color-gray-800, #444950);
2626
background-color: transparent;
27-
border: 2px solid var(--ifm-color-gray-400, #cfd3d9);
27+
border: 1px solid var(--ifm-color-gray-400, #cfd3d9);
2828
border-radius: 8px;
2929
padding: 0.45rem 0.5rem;
3030
cursor: pointer;
@@ -62,7 +62,7 @@
6262
margin-left: 0.2rem;
6363
transition: transform 0.2s ease;
6464
color: var(--ifm-color-gray-800, #444950);
65-
stroke-width: 2px;
65+
stroke-width: 1.5px;
6666
}
6767

6868
.button[aria-expanded="true"] .icon {

src/theme/DocItem/Layout/styles.module.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
overflow-wrap: break-word;
1717
word-wrap: break-word;
1818
hyphens: auto;
19-
max-width: calc(100% - 150px);
19+
max-width: calc(100% - 180px);
2020
line-height: 1.2;
2121
}
2222

@@ -40,7 +40,7 @@
4040
.docTitle {
4141
margin-bottom: 0;
4242
font-size: 2rem;
43-
max-width: calc(100% - 120px);
43+
max-width: calc(100% - 150px);
4444
}
4545
}
4646

0 commit comments

Comments
 (0)