Skip to content

Commit

Permalink
fix: fix multiple playground options missing
Browse files Browse the repository at this point in the history
  • Loading branch information
nattallius committed Aug 10, 2023
1 parent 033e362 commit efbb8bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions src/plugins/header/options/OptionIcons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,18 @@ export class UIPOptionIcons {
) as HTMLElement;

/** Default svg for copy icon */
public static copySVG: HTMLElement = (
<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#5f5f5f" stroke-width="1.25">
public static get copySVG() {
return <svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#5f5f5f" stroke-width="1.25">
<rect width="12" height="15" x="4" y="3" fill="#fff" rx="2"/>
<rect width="12" height="15" x="8" y="7" fill="#fff" rx="2"/>
</svg>
) as HTMLElement;
</svg> as HTMLElement;
}

public static snippetSVG: HTMLElement = (
<svg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' viewBox='0 0 16 9' xmlSpace='preserve'>
<polyline points='0,0 8,8 16,0' stroke-width='2'></polyline>
</svg>
) as HTMLElement;
public static get snippetSVG() {
return <>
<svg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' viewBox='0 0 16 9' xmlSpace='preserve'>
<polyline points='0,0 8,8 16,0' stroke-width='2'></polyline>
</svg>
</> as HTMLElement;
}
}
2 changes: 1 addition & 1 deletion src/plugins/header/options/option/option.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class UIPOption extends ESLBaseElement {

/** Builds option element from {@link OptionConfig} */
static createEl(optionConfig: OptionConfig) {
const option = <uip-option attribute={optionConfig.optionValue}>{optionConfig.svg}</uip-option> as UIPOption;
const option = <uip-option attribute={optionConfig.optionValue}>{optionConfig.svg.cloneNode(true)}</uip-option> as UIPOption;
option.config = optionConfig;
return option;
}
Expand Down

0 comments on commit efbb8bf

Please sign in to comment.