Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Prefer SVG over font icons in the demos #17056

Merged
merged 2 commits into from
Aug 21, 2019
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import BottomNavigation from '@material-ui/core/BottomNavigation';
import BottomNavigationAction from '@material-ui/core/BottomNavigationAction';
import Icon from '@material-ui/core/Icon';
import FolderIcon from '@material-ui/icons/Folder';
import RestoreIcon from '@material-ui/icons/Restore';
import FavoriteIcon from '@material-ui/icons/Favorite';
import LocationOnIcon from '@material-ui/icons/LocationOn';
Expand All @@ -26,7 +26,7 @@ export default function LabelBottomNavigation() {
<BottomNavigationAction label="Recents" value="recents" icon={<RestoreIcon />} />
<BottomNavigationAction label="Favorites" value="favorites" icon={<FavoriteIcon />} />
<BottomNavigationAction label="Nearby" value="nearby" icon={<LocationOnIcon />} />
<BottomNavigationAction label="Folder" value="folder" icon={<Icon>folder</Icon>} />
<BottomNavigationAction label="Folder" value="folder" icon={<FolderIcon />} />
</BottomNavigation>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import BottomNavigation from '@material-ui/core/BottomNavigation';
import BottomNavigationAction from '@material-ui/core/BottomNavigationAction';
import Icon from '@material-ui/core/Icon';
import FolderIcon from '@material-ui/icons/Folder';
import RestoreIcon from '@material-ui/icons/Restore';
import FavoriteIcon from '@material-ui/icons/Favorite';
import LocationOnIcon from '@material-ui/icons/LocationOn';
Expand All @@ -26,7 +26,7 @@ export default function LabelBottomNavigation() {
<BottomNavigationAction label="Recents" value="recents" icon={<RestoreIcon />} />
<BottomNavigationAction label="Favorites" value="favorites" icon={<FavoriteIcon />} />
<BottomNavigationAction label="Nearby" value="nearby" icon={<LocationOnIcon />} />
<BottomNavigationAction label="Folder" value="folder" icon={<Icon>folder</Icon>} />
<BottomNavigationAction label="Folder" value="folder" icon={<FolderIcon />} />
</BottomNavigation>
);
}
4 changes: 2 additions & 2 deletions docs/src/pages/components/buttons/FloatingActionButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Fab from '@material-ui/core/Fab';
import AddIcon from '@material-ui/icons/Add';
import Icon from '@material-ui/core/Icon';
import EditIcon from '@material-ui/icons/Edit';
import DeleteIcon from '@material-ui/icons/Delete';
import NavigationIcon from '@material-ui/icons/Navigation';

Expand All @@ -24,7 +24,7 @@ export default function FloatingActionButtons() {
<AddIcon />
</Fab>
<Fab color="secondary" aria-label="edit" className={classes.fab}>
<Icon>edit_icon</Icon>
<EditIcon />
</Fab>
<Fab variant="extended" aria-label="delete" className={classes.fab}>
<NavigationIcon className={classes.extendedIcon} />
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/components/buttons/FloatingActionButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles';
import Fab from '@material-ui/core/Fab';
import AddIcon from '@material-ui/icons/Add';
import Icon from '@material-ui/core/Icon';
import EditIcon from '@material-ui/icons/Edit';
import DeleteIcon from '@material-ui/icons/Delete';
import NavigationIcon from '@material-ui/icons/Navigation';

Expand All @@ -26,7 +26,7 @@ export default function FloatingActionButtons() {
<AddIcon />
</Fab>
<Fab color="secondary" aria-label="edit" className={classes.fab}>
<Icon>edit_icon</Icon>
<EditIcon />
</Fab>
<Fab variant="extended" aria-label="delete" className={classes.fab}>
<NavigationIcon className={classes.extendedIcon} />
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/components/buttons/IconButtons.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Icon from '@material-ui/core/Icon';
import IconButton from '@material-ui/core/IconButton';
import DeleteIcon from '@material-ui/icons/Delete';
import AlarmIcon from '@material-ui/icons/Alarm';
import AddShoppingCartIcon from '@material-ui/icons/AddShoppingCart';
import PhotoCamera from '@material-ui/icons/PhotoCamera';

Expand All @@ -27,7 +27,7 @@ export default function IconButtons() {
<DeleteIcon />
</IconButton>
<IconButton color="secondary" className={classes.button} aria-label="add an alarm">
<Icon>alarm</Icon>
<AlarmIcon />
</IconButton>
<IconButton color="primary" className={classes.button} aria-label="add to shopping cart">
<AddShoppingCartIcon />
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/components/buttons/IconButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles';
import Icon from '@material-ui/core/Icon';
import IconButton from '@material-ui/core/IconButton';
import DeleteIcon from '@material-ui/icons/Delete';
import AlarmIcon from '@material-ui/icons/Alarm';
import AddShoppingCartIcon from '@material-ui/icons/AddShoppingCart';
import PhotoCamera from '@material-ui/icons/PhotoCamera';

Expand All @@ -29,7 +29,7 @@ export default function IconButtons() {
<DeleteIcon />
</IconButton>
<IconButton color="secondary" className={classes.button} aria-label="add an alarm">
<Icon>alarm</Icon>
<AlarmIcon />
</IconButton>
<IconButton color="primary" className={classes.button} aria-label="add to shopping cart">
<AddShoppingCartIcon />
Expand Down
24 changes: 24 additions & 0 deletions test/regressions/tests/Button/FontSvgIcons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import Fab from '@material-ui/core/Fab';
import IconButton from '@material-ui/core/IconButton';
import DeleteIcon from '@material-ui/icons/Delete';
import Icon from '@material-ui/core/Icon';

export default function FontSvgIcons() {
return (
<div>
<Fab color="primary">
<DeleteIcon />
</Fab>
<Fab color="primary">
<Icon>delete_icon</Icon>
</Fab>
<IconButton>
<DeleteIcon />
</IconButton>
<IconButton>
<Icon>delete_icon</Icon>
</IconButton>
</div>
);
}