mirror of
https://github.com/iconify/iconify.git
synced 2025-01-06 07:20:40 +00:00
Minor fixes
This commit is contained in:
parent
8bd6d0768c
commit
0045b0e403
@ -4,7 +4,7 @@
|
||||
"module": "commonjs",
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"sourceMap": true,
|
||||
"sourceMap": false,
|
||||
"composite": true,
|
||||
"strict": true,
|
||||
"moduleResolution": "node",
|
||||
|
4
packages/react-demo/src/App.js
vendored
4
packages/react-demo/src/App.js
vendored
@ -7,7 +7,7 @@ import {
|
||||
addIcon as addOnlineIcon,
|
||||
addCollection as addOnlineCollection,
|
||||
disableCache,
|
||||
} from '@iconify/react/dist/iconify';
|
||||
} from '@iconify/react';
|
||||
import presentationPlay from '@iconify-icons/mdi-light/presentation-play';
|
||||
import playIcon from '@iconify-icons/mdi-light/play';
|
||||
|
||||
@ -31,7 +31,7 @@ addOfflineIcon('demo', presentationPlay);
|
||||
// Add 'mdi-light:play' as 'demo' for full module
|
||||
addOnlineIcon('demo', playIcon);
|
||||
|
||||
// Add custom icon as 'experiment'
|
||||
// Add different custom icons as 'experiment2' for offline and online modes
|
||||
addOfflineIcon('experiment2', {
|
||||
width: 16,
|
||||
height: 16,
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Icon as OfflineIcon } from '@iconify/react/dist/offline';
|
||||
import { Icon as FullIcon } from '@iconify/react/dist/iconify';
|
||||
import { Icon as FullIcon } from '@iconify/react';
|
||||
|
||||
export function InlineDemo() {
|
||||
return (
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Icon } from '@iconify/react/dist/iconify';
|
||||
import { Icon } from '@iconify/react';
|
||||
|
||||
export function FullUsageDemo() {
|
||||
return (
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Icon } from '@iconify/react/dist/iconify';
|
||||
import { Icon } from '@iconify/react';
|
||||
import accountIcon from '@iconify-icons/mdi-light/account';
|
||||
import alertIcon from '@iconify-icons/mdi-light/alert';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { InlineIcon, addAPIProvider, _api } from '@iconify/react/dist/iconify';
|
||||
import { InlineIcon, addAPIProvider, _api } from '@iconify/react';
|
||||
import { mockAPIModule, mockAPIData } from '@iconify/core/lib/api/modules/mock';
|
||||
import { TestIcons, toggleTest } from './TestIcons';
|
||||
import playIcon from '@iconify-icons/mdi-light/map-marker';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { InlineIcon } from '@iconify/react/dist/iconify';
|
||||
import { InlineIcon } from '@iconify/react';
|
||||
import { TestIcons, toggleTest } from './TestIcons';
|
||||
|
||||
export function TestsFullOffline() {
|
||||
|
@ -104,7 +104,7 @@ export const render = (
|
||||
if (typeof value === 'string') {
|
||||
customisations[key] = rotateFromString(value);
|
||||
} else if (typeof value === 'number') {
|
||||
componentProps[key] = value;
|
||||
customisations[key] = value;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
addIcon as addOnlineIcon,
|
||||
addCollection as addOnlineCollection,
|
||||
disableCache,
|
||||
} from '@iconify/svelte/dist/iconify';
|
||||
} from '@iconify/svelte';
|
||||
|
||||
import presentationPlay from '@iconify-icons/mdi-light/presentation-play';
|
||||
import playIcon from '@iconify-icons/mdi-light/play';
|
||||
|
@ -288,22 +288,6 @@ if (typeof document !== 'undefined' && typeof window !== 'undefined') {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
.
|
||||
|
||||
.
|
||||
|
||||
.
|
||||
|
||||
.
|
||||
|
||||
.
|
||||
|
||||
.
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* Function to get icon status
|
||||
*/
|
||||
|
@ -83,7 +83,7 @@ export function render(
|
||||
if (typeof value === 'string') {
|
||||
customisations[key] = rotateFromString(value);
|
||||
} else if (typeof value === 'number') {
|
||||
componentProps[key] = value;
|
||||
customisations[key] = value;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -80,31 +80,6 @@ export function addCollection(
|
||||
/**
|
||||
* Component
|
||||
*/
|
||||
/*
|
||||
// Currently this cannot be used because in functional component style is inherited, overriding style generated by render()
|
||||
export function Icon(props: Record<string, unknown>, context): VNode {
|
||||
// Check icon
|
||||
const icon =
|
||||
typeof props.icon === 'string'
|
||||
? storage[props.icon]
|
||||
: typeof props.icon === 'object'
|
||||
? fullIcon(props.icon as IconifyIcon)
|
||||
: null;
|
||||
|
||||
// Validate icon object
|
||||
if (
|
||||
icon === null ||
|
||||
typeof icon !== 'object' ||
|
||||
typeof icon.body !== 'string'
|
||||
) {
|
||||
return context.slots.default ? context.slots.default() : null;
|
||||
}
|
||||
|
||||
// Valid icon: render it
|
||||
return render(icon, context.attrs as IconProps);
|
||||
}
|
||||
*/
|
||||
|
||||
export const Icon = defineComponent({
|
||||
// Do not inherit other attributes: it is handled by render()
|
||||
inheritAttrs: false,
|
||||
|
Loading…
Reference in New Issue
Block a user