diff --git a/examples/svg-icon/index.js b/examples/svg-icon/index.js
index c18e7606d..12d8d9925 100644
--- a/examples/svg-icon/index.js
+++ b/examples/svg-icon/index.js
@@ -31,45 +31,37 @@ const icons = (
Icon with no icon or children properties defined
-
-
Icon not found
-
-
Icon with custom defined path
{children}
-
Disabled icon
-
-
-
-
Icon color
-
+ Icon not found
+
-
Star, also with className prop
-
+ Add
+
-
StarBorder
-
+ ArrowDownward
+
ArrowDropRight
-
-
Close
-
-
ArrowUpward
-
ArrowDownward
-
+ Business
+
+
+
+
Cancel
+
ChevronLeft
@@ -80,64 +72,96 @@ const icons = (
-
MoreVert
-
+ Close
+
-
Cancel
-
+ Create
+
-
InfoOutline
-
+ Delete
+
-
Room
-
+ Done
+
-
ViewList
-
+ DragHandle
+
-
Delete
-
+ GridOn
+
-
Visibility
-
+ Group
+
-
VisibilityOff
-
+ InfoOutline
+
-
Create
-
+ InsertChart
+
-
DragHandle
-
+ Message
+
-
GridOn
-
+ MoreVert
+
-
ShowChart
-
+ NotInterested
+
-
InsertChart
-
+ Person
+
Public
-
Message
-
+ Room
+
+
+
+
ShowChart
+
+
+
+
Disabled icon
+
+
+
+
Icon color
+
+
+
+
Star, also with className prop
+
+
+
+
StarBorder
+
+
+
+
ViewList
+
+
+
+
Visibility
+
+
+
+
VisibilityOff
+
diff --git a/src/sharing/Access.component.js b/src/sharing/Access.component.js
index f74c68cf8..a4c364fb6 100644
--- a/src/sharing/Access.component.js
+++ b/src/sharing/Access.component.js
@@ -1,16 +1,13 @@
import PropTypes from 'prop-types';
import React from 'react';
import { compose, mapProps, getContext, withProps } from 'recompose';
-import FontIcon from 'material-ui/FontIcon';
import { config } from 'd2/lib/d2';
import IconButton from 'material-ui/IconButton';
+import SvgIcon from '../svg-icon/SvgIcon';
import PermissionPicker from './PermissionPicker.component';
-import {
- accessStringToObject,
- accessObjectToString,
-} from './utils';
+import { accessStringToObject, accessObjectToString } from './utils';
config.i18n.strings.add('public_access');
config.i18n.strings.add('external_access');
@@ -40,20 +37,25 @@ const d2Context = {
d2: PropTypes.object.isRequired,
};
-const getAccessIcon = (userType) => {
+const getAccessIcon = userType => {
switch (userType) {
- case 'user': return 'person';
- case 'userGroup': return 'group';
- case 'external': return 'public';
- case 'public': return 'business';
- default: return 'person';
+ case 'user':
+ return 'Person';
+ case 'userGroup':
+ return 'Group';
+ case 'external':
+ return 'Public';
+ case 'public':
+ return 'Business';
+ default:
+ return 'Person';
}
};
const useAccessObjectFormat = props => ({
...props,
access: accessStringToObject(props.access),
- onChange: (newAccess) => {
+ onChange: newAccess => {
props.onChange(accessObjectToString(newAccess));
},
});
@@ -69,27 +71,26 @@ export const Access = ({
disabled,
}) => (
-
- {getAccessIcon(accessType)}
-
+
{primaryText}
-
{secondaryText || ' '}
+
+ {secondaryText || ' '}
+
-
-
{})}
- >clear
+ >
+
+
);
@@ -119,9 +120,13 @@ export const GroupAccess = compose(
primaryText: props.groupName,
accessOptions: {
meta: { canView: true, canEdit: true, noAccess: false },
- data: props.dataShareable && { canView: true, canEdit: true, noAccess: true },
+ data: props.dataShareable && {
+ canView: true,
+ canEdit: true,
+ noAccess: true,
+ },
},
- })),
+ }))
)(Access);
export const ExternalAccess = compose(
@@ -136,13 +141,13 @@ export const ExternalAccess = compose(
meta: { canEdit: false, canView: props.access },
data: { canEdit: false, canView: false },
},
- onChange: (newAccess) => {
+ onChange: newAccess => {
props.onChange(newAccess.meta.canView);
},
accessOptions: {
meta: { canView: true, canEdit: false, noAccess: true },
},
- })),
+ }))
)(Access);
const constructSecondaryText = ({ canView, canEdit }) => {
@@ -150,9 +155,7 @@ const constructSecondaryText = ({ canView, canEdit }) => {
return 'anyone_can_find_view_and_edit';
}
- return canView
- ? 'anyone_can_find_and_view'
- : 'no_access';
+ return canView ? 'anyone_can_find_and_view' : 'no_access';
};
export const PublicAccess = compose(
@@ -161,10 +164,16 @@ export const PublicAccess = compose(
withProps(props => ({
accessType: 'public',
primaryText: props.d2.i18n.getTranslation('public_access'),
- secondaryText: props.d2.i18n.getTranslation(constructSecondaryText(props.access.meta)),
+ secondaryText: props.d2.i18n.getTranslation(
+ constructSecondaryText(props.access.meta)
+ ),
accessOptions: {
meta: { canView: true, canEdit: true, noAccess: true },
- data: props.dataShareable && { canView: true, canEdit: true, noAccess: true },
+ data: props.dataShareable && {
+ canView: true,
+ canEdit: true,
+ noAccess: true,
+ },
},
- })),
+ }))
)(Access);
diff --git a/src/sharing/PermissionOption.component.js b/src/sharing/PermissionOption.component.js
index 8f49a75a4..2067b5f0c 100644
--- a/src/sharing/PermissionOption.component.js
+++ b/src/sharing/PermissionOption.component.js
@@ -1,6 +1,6 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
-import FontIcon from 'material-ui/FontIcon';
+import SvgIcon from '../svg-icon/SvgIcon';
import MenuItem from 'material-ui/MenuItem';
class PermissionOption extends Component {
@@ -15,9 +15,7 @@ class PermissionOption extends Component {