Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/scripts/index.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions playground/src/components/AppProvider/AppProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface AppProviderContext {
windowSizes: WindowSizes;
setCode: (code: string) => void;
share: (code: string, options: string) => void;
setOptions: (options: PluginOptions) => void;
setOptionsOpen: React.Dispatch<React.SetStateAction<boolean>>;
changeOptionsMode: (mode: Mode) => void;
changeOptionsSource: (source: Source) => void;
Expand Down Expand Up @@ -110,6 +111,7 @@ export const AppProvider = (props: PropsWithChildren<{}>): JSX.Element => {
optionsOpen,
setCode,
share,
setOptions,
setOptionsOpen,
changeOptionsMode,
changeOptionsSource,
Expand Down
32 changes: 2 additions & 30 deletions playground/src/components/Options/Options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { isBoolean } from '@utilities/types';
export const Options = (): JSX.Element => {

const {
setOptions,
optionsOpen,
changeOptionsMode,
changeOptionsSource,
Expand Down Expand Up @@ -52,36 +53,7 @@ export const Options = (): JSX.Element => {

useEffect(() => {
if (fetchOptions) {
if (fetchOptions.mode) {
changeMode(fetchOptions.mode as string);
}
if (fetchOptions.source) {
changeSource(fetchOptions.source === 'rtl');
}
if (isBoolean(fetchOptions.safeBothPrefix)) {
changeIgnorePrefixedRules(fetchOptions.safeBothPrefix as boolean);
}
if (isBoolean(fetchOptions.ignorePrefixedRules)) {
changeIgnorePrefixedRules(fetchOptions.ignorePrefixedRules as boolean);
}
if (isBoolean(fetchOptions.processUrls)) {
changeProcessUrls(fetchOptions.processUrls as boolean);
}
if (isBoolean(fetchOptions.processKeyFrames)) {
changeProcessKeyframes(fetchOptions.processKeyFrames as boolean);
}
if (isBoolean(fetchOptions.processEnv)) {
changeProcessEnv(fetchOptions.processEnv as boolean);
}
if (isBoolean(fetchOptions.useCalc)) {
changeUseCalc(fetchOptions.useCalc as boolean);
}
if (fetchOptions.autoRename) {
changeAutoRename(fetchOptions.autoRename as string);
}
if (isBoolean(fetchOptions.greedy)) {
changeGreedy(fetchOptions.greedy as boolean);
}
setOptions(fetchOptions);
}
}, [fetchOptions]);

Expand Down