Skip to content

Commit 4f539d7

Browse files
committed
remove icon on mount
1 parent 78760bf commit 4f539d7

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

src/components/IDE.js

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -584,14 +584,16 @@ export default function IDE({
584584
reader.readAsText(file);
585585
};
586586

587-
const aWithHref = document.querySelectorAll("a[href]");
588-
aWithHref.forEach((a) => {
589-
if (
590-
a.getAttribute("href") === "https://codeium.com?referrer=codeium-editor"
591-
) {
592-
a.remove();
593-
}
594-
});
587+
const removeCodeiumIcon = () => {
588+
const aWithHref = document.querySelectorAll("a[href]");
589+
aWithHref.forEach((a) => {
590+
if (
591+
a.getAttribute("href") === "https://codeium.com?referrer=codeium-editor"
592+
) {
593+
a.remove();
594+
}
595+
});
596+
};
595597

596598
return (
597599
<>
@@ -625,21 +627,10 @@ export default function IDE({
625627
onChange={(value) => {
626628
setpython(value);
627629
}}
630+
beforeMount={removeCodeiumIcon}
628631
className="flex-grow text-base"
629632
defaultValue={python}
630633
theme="vs-dark"
631-
// value={python}
632-
// className="flex-grow text-base"
633-
// options={{
634-
// mode: "python",
635-
// theme: "dracula",
636-
// lineNumbers: true,
637-
// scrollbarStyle: null,
638-
// lineWrapping: true,
639-
// }}
640-
// onBeforeChange={(editor, data, changes) => {
641-
// setpython(changes);
642-
// }}
643634
/>
644635
)}
645636
{selected === "cpp" && (
@@ -649,6 +640,7 @@ export default function IDE({
649640
onChange={(value) => {
650641
setcpp(value);
651642
}}
643+
beforeMount={removeCodeiumIcon}
652644
className="flex-grow text-base"
653645
defaultValue={cpp}
654646
theme="vs-dark"
@@ -661,6 +653,7 @@ export default function IDE({
661653
onChange={(value) => {
662654
setjava(value);
663655
}}
656+
beforeMount={removeCodeiumIcon}
664657
className="flex-grow text-base"
665658
defaultValue={java}
666659
theme="vs-dark"
@@ -673,6 +666,7 @@ export default function IDE({
673666
onChange={(value) => {
674667
setjs(value);
675668
}}
669+
beforeMount={removeCodeiumIcon}
676670
className="flex-grow text-base"
677671
defaultValue={js}
678672
theme="vs-dark"
@@ -685,6 +679,7 @@ export default function IDE({
685679
onChange={(value) => {
686680
setruby(value);
687681
}}
682+
beforeMount={removeCodeiumIcon}
688683
className="flex-grow text-base"
689684
defaultValue={ruby}
690685
theme="vs-dark"
@@ -697,6 +692,7 @@ export default function IDE({
697692
onChange={(value) => {
698693
setphp(value);
699694
}}
695+
beforeMount={removeCodeiumIcon}
700696
className="flex-grow text-base"
701697
defaultValue={php}
702698
theme="vs-dark"
@@ -709,6 +705,7 @@ export default function IDE({
709705
onChange={(value) => {
710706
setperl(value);
711707
}}
708+
beforeMount={removeCodeiumIcon}
712709
className="flex-grow text-base"
713710
defaultValue={perl}
714711
theme="vs-dark"

0 commit comments

Comments
 (0)