@plusscommunities/pluss-core-web 1.6.13-beta.0 → 1.6.15-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/package.json +1 -2
  2. package/rollup.config.js +45 -45
  3. package/src/actions/AuthActions.js +40 -40
  4. package/src/actions/LocalActions.js +5 -5
  5. package/src/actions/NavActions.js +5 -5
  6. package/src/actions/ScheduledActionsActions.js +5 -5
  7. package/src/actions/TemplateActions.js +9 -9
  8. package/src/actions/UsersActions.js +74 -70
  9. package/src/actions/index.js +6 -6
  10. package/src/actions/types.js +17 -17
  11. package/src/analytics.js +178 -158
  12. package/src/apis/analyticsActions.js +50 -50
  13. package/src/apis/authActions.js +55 -55
  14. package/src/apis/fileActions.js +147 -142
  15. package/src/apis/index.js +10 -10
  16. package/src/apis/profileActions.js +130 -130
  17. package/src/apis/scheduledActionsActions.js +9 -9
  18. package/src/apis/stringActions.js +26 -22
  19. package/src/apis/templateActions.js +38 -38
  20. package/src/apis/typeActions.js +183 -183
  21. package/src/apis/userActions.js +166 -166
  22. package/src/apis/utilityActions.js +32 -32
  23. package/src/colours.js +79 -77
  24. package/src/components/AddButton.js +29 -20
  25. package/src/components/AnalyticsFilter.js +136 -102
  26. package/src/components/Attachment.js +36 -22
  27. package/src/components/AudienceIncluder.js +209 -165
  28. package/src/components/AudienceSelector.js +680 -680
  29. package/src/components/Button.js +79 -56
  30. package/src/components/CheckBox.js +77 -65
  31. package/src/components/ColourOptions.js +205 -181
  32. package/src/components/ColourPicker.js +286 -244
  33. package/src/components/Comment.js +48 -39
  34. package/src/components/CommentSection.js +113 -103
  35. package/src/components/DatePicker.js +298 -255
  36. package/src/components/DropdownInput.js +236 -215
  37. package/src/components/DurationInput.js +46 -43
  38. package/src/components/ExportCsvPopup.js +236 -217
  39. package/src/components/FileInput.js +359 -346
  40. package/src/components/GenericInput.js +184 -153
  41. package/src/components/Header.js +88 -65
  42. package/src/components/HubSidebar.js +136 -124
  43. package/src/components/ImageInput.js +1182 -973
  44. package/src/components/InputGroup.js +20 -13
  45. package/src/components/MakerPopup.js +285 -278
  46. package/src/components/MoreMenu.js +21 -17
  47. package/src/components/OptionsSection.js +86 -74
  48. package/src/components/OverlayPage.js +61 -61
  49. package/src/components/OverlayPageBottomButtons.js +38 -38
  50. package/src/components/OverlayPageContents.js +38 -38
  51. package/src/components/OverlayPageSection.js +24 -24
  52. package/src/components/P60Icon.js +38 -33
  53. package/src/components/PageTitle.js +8 -8
  54. package/src/components/Popup.js +114 -95
  55. package/src/components/ProfilePic.js +40 -40
  56. package/src/components/RadioButton.js +142 -126
  57. package/src/components/Reactions.js +66 -66
  58. package/src/components/SVGIcon.js +31 -25
  59. package/src/components/SideNavItem.js +112 -83
  60. package/src/components/StatBox.js +54 -44
  61. package/src/components/StatusButton.js +31 -17
  62. package/src/components/SuccessPopup.js +61 -48
  63. package/src/components/Tabs.js +50 -47
  64. package/src/components/Tag.js +54 -54
  65. package/src/components/Text.js +18 -14
  66. package/src/components/TextFormatPopup.js +77 -49
  67. package/src/components/TimePicker.js +214 -200
  68. package/src/components/ToggleSwitch.js +60 -0
  69. package/src/components/UserListing.js +110 -97
  70. package/src/components/index.js +46 -46
  71. package/src/components/svg-icons.json +819 -819
  72. package/src/config.js +22 -22
  73. package/src/helper/HelpDeskWidget.js +4 -4
  74. package/src/helper/api/getUrl.js +16 -11
  75. package/src/helper/api/getUrlParams.js +8 -5
  76. package/src/helper/api/safeReadParams.js +3 -2
  77. package/src/helper/auth/getUserFromState.js +4 -4
  78. package/src/helper/colours/getAppColourFromState.js +10 -5
  79. package/src/helper/files/canvasImageUploader.js +152 -140
  80. package/src/helper/files/generateImageName.js +6 -6
  81. package/src/helper/files/get1400.js +33 -25
  82. package/src/helper/files/getExtension.js +5 -5
  83. package/src/helper/files/getFileName.js +9 -9
  84. package/src/helper/files/getThumb300.js +37 -29
  85. package/src/helper/files/isVideo.js +3 -3
  86. package/src/helper/helper.js +59 -56
  87. package/src/helper/index.js +29 -29
  88. package/src/helper/site/getMerchantsFromState.js +8 -4
  89. package/src/helper/site/getSiteLevelFromState.js +29 -29
  90. package/src/helper/site/getSiteName.js +11 -11
  91. package/src/helper/site/getSiteNameFromRoles.js +7 -7
  92. package/src/helper/site/getSiteSettingFromState.js +10 -5
  93. package/src/helper/storage/readJSONFromStorage.js +5 -5
  94. package/src/helper/storage/readStorageWithCookie.js +17 -17
  95. package/src/helper/storage/setLocalStorage.js +1 -1
  96. package/src/helper/strings/getFirstName.js +5 -5
  97. package/src/helper/strings/htmlDecode.js +2 -2
  98. package/src/helper/strings/htmlEncode.js +2 -2
  99. package/src/helper/strings/isEmail.js +7 -6
  100. package/src/helper/strings/isUrl.js +7 -7
  101. package/src/helper/strings/onlyAlphanumeric.js +4 -4
  102. package/src/helper/strings/randomString.js +6 -6
  103. package/src/helper/strings/toParagraphed.js +12 -12
  104. package/src/index.js +22 -11
  105. package/src/reducers/ScheduledActionsReducer.js +8 -8
  106. package/src/reducers/TemplatesReducer.js +22 -22
  107. package/src/reducers/index.js +4 -4
  108. package/src/session.js +70 -70
  109. package/src/urls.js +17 -16
  110. package/dist/index.cjs.js +0 -11623
  111. package/dist/index.esm.js +0 -11583
  112. package/dist/index.umd.js +0 -11595
@@ -1,169 +1,169 @@
1
- import _ from 'lodash';
2
- import { authedFunction } from '../session';
3
- import { getUrl } from '../helper';
1
+ import _ from "lodash";
2
+ import { authedFunction } from "../session";
3
+ import { getUrl } from "../helper";
4
4
 
5
5
  export const userActions = {
6
- createNewUser: (user, userExtra) => {
7
- return authedFunction({
8
- method: 'POST',
9
- url: getUrl('users', 'add'),
10
- data: {
11
- user,
12
- userExtra,
13
- },
14
- });
15
- },
16
- bulkNewUser: (users, site, sendWelcome) => {
17
- return authedFunction({
18
- method: 'POST',
19
- url: getUrl('users', 'addbulk'),
20
- data: {
21
- site,
22
- users,
23
- sendWelcome,
24
- },
25
- });
26
- },
27
- getbulks: (site) => {
28
- return authedFunction({
29
- method: 'POST',
30
- url: getUrl('users', 'getbulks'),
31
- data: {
32
- site,
33
- },
34
- });
35
- },
36
- fetchUsers: (site) => {
37
- return authedFunction({
38
- method: 'POST',
39
- url: getUrl('users', 'get'),
40
- data: {
41
- site,
42
- },
43
- });
44
- },
45
- fetchInitialPasswords: (site) => {
46
- return authedFunction({
47
- method: 'GET',
48
- url: getUrl('users', 'initialpasswords', { site }),
49
- });
50
- },
51
- fetchUser: (site, userId) => {
52
- return authedFunction({
53
- method: 'POST',
54
- url: getUrl('users', 'getsingle'),
55
- data: {
56
- site,
57
- userId,
58
- },
59
- });
60
- },
61
- updateUser: (site, userId, user) => {
62
- return authedFunction({
63
- method: 'POST',
64
- url: getUrl('users', 'manageUser'),
65
- data: {
66
- site,
67
- userId,
68
- user,
69
- },
70
- });
71
- },
72
- getSiteResidentsCount: (site) => {
73
- return authedFunction({
74
- method: 'POST',
75
- url: getUrl('users', 'getexp'),
76
- data: { site, isCount: true },
77
- });
78
- },
79
- sendWelcomeEmail: (site, userId) => {
80
- return authedFunction({
81
- method: 'POST',
82
- url: getUrl('users', 'welcome/email'),
83
- data: { site, userId },
84
- });
85
- },
86
- sendWelcomeText: (site, userId) => {
87
- return authedFunction({
88
- method: 'POST',
89
- url: getUrl('users', 'welcome/text'),
90
- data: { site, userId },
91
- });
92
- },
93
- getInviteCode: (userId, type, site) => {
94
- const query = {};
95
- if (!_.isEmpty(userId)) {
96
- query.userId = userId;
97
- }
98
- if (!_.isEmpty(type)) {
99
- query.type = type;
100
- }
101
- if (!_.isEmpty(site)) {
102
- query.site = site;
103
- }
104
- return authedFunction({
105
- method: 'GET',
106
- url: getUrl('users', 'invite/get', query),
107
- });
108
- },
109
- generateInviteCode: (userId, type, site) => {
110
- const data = {};
111
- if (!_.isEmpty(userId)) {
112
- data.userId = userId;
113
- }
114
- if (!_.isEmpty(type)) {
115
- data.type = type;
116
- }
117
- if (!_.isEmpty(site)) {
118
- data.site = site;
119
- }
120
- return authedFunction({
121
- method: 'POST',
122
- url: getUrl('users', 'invite/generate'),
123
- data,
124
- });
125
- },
126
- createInviteCode: (userId, site, userType, expiry) => {
127
- return authedFunction({
128
- method: 'POST',
129
- url: getUrl('users', 'invite/update/add'),
130
- data: { userId, site, userType, expiry },
131
- });
132
- },
133
- editInviteCode: (code, userType, expiry) => {
134
- return authedFunction({
135
- method: 'POST',
136
- url: getUrl('users', 'invite/update/edit'),
137
- data: { code, userType, expiry },
138
- });
139
- },
140
- deleteInviteCode: (code) => {
141
- return authedFunction({
142
- method: 'POST',
143
- url: getUrl('users', 'invite/update/delete'),
144
- data: { code },
145
- });
146
- },
147
- getInviteCodes: (site, excludeFamily = false) => {
148
- const action = excludeFamily ? 'excludeFamily' : 'all';
149
- return authedFunction({
150
- method: 'GET',
151
- url: getUrl('users', `invite/get/${action}`, { site }),
152
- });
153
- },
154
- getInviteCodeByCode: (code) => {
155
- return authedFunction({
156
- method: 'GET',
157
- url: getUrl('users', 'invite/get/code', { code }),
158
- });
159
- },
160
- updateProfile: (input) => {
161
- return authedFunction({
162
- method: 'POST',
163
- url: getUrl('users', 'updateProfile'),
164
- data: {
165
- details: input,
166
- },
167
- });
168
- },
6
+ createNewUser: (user, userExtra) => {
7
+ return authedFunction({
8
+ method: "POST",
9
+ url: getUrl("users", "add"),
10
+ data: {
11
+ user,
12
+ userExtra,
13
+ },
14
+ });
15
+ },
16
+ bulkNewUser: (users, site, sendWelcome) => {
17
+ return authedFunction({
18
+ method: "POST",
19
+ url: getUrl("users", "addbulk"),
20
+ data: {
21
+ site,
22
+ users,
23
+ sendWelcome,
24
+ },
25
+ });
26
+ },
27
+ getbulks: (site) => {
28
+ return authedFunction({
29
+ method: "POST",
30
+ url: getUrl("users", "getbulks"),
31
+ data: {
32
+ site,
33
+ },
34
+ });
35
+ },
36
+ fetchUsers: (site) => {
37
+ return authedFunction({
38
+ method: "POST",
39
+ url: getUrl("users", "get"),
40
+ data: {
41
+ site,
42
+ },
43
+ });
44
+ },
45
+ fetchInitialPasswords: (site) => {
46
+ return authedFunction({
47
+ method: "GET",
48
+ url: getUrl("users", "initialpasswords", { site }),
49
+ });
50
+ },
51
+ fetchUser: (site, userId) => {
52
+ return authedFunction({
53
+ method: "POST",
54
+ url: getUrl("users", "getsingle"),
55
+ data: {
56
+ site,
57
+ userId,
58
+ },
59
+ });
60
+ },
61
+ updateUser: (site, userId, user) => {
62
+ return authedFunction({
63
+ method: "POST",
64
+ url: getUrl("users", "manageUser"),
65
+ data: {
66
+ site,
67
+ userId,
68
+ user,
69
+ },
70
+ });
71
+ },
72
+ getSiteResidentsCount: (site) => {
73
+ return authedFunction({
74
+ method: "POST",
75
+ url: getUrl("users", "getexp"),
76
+ data: { site, isCount: true },
77
+ });
78
+ },
79
+ sendWelcomeEmail: (site, userId) => {
80
+ return authedFunction({
81
+ method: "POST",
82
+ url: getUrl("users", "welcome/email"),
83
+ data: { site, userId },
84
+ });
85
+ },
86
+ sendWelcomeText: (site, userId) => {
87
+ return authedFunction({
88
+ method: "POST",
89
+ url: getUrl("users", "welcome/text"),
90
+ data: { site, userId },
91
+ });
92
+ },
93
+ getInviteCode: (userId, type, site) => {
94
+ const query = {};
95
+ if (!_.isEmpty(userId)) {
96
+ query.userId = userId;
97
+ }
98
+ if (!_.isEmpty(type)) {
99
+ query.type = type;
100
+ }
101
+ if (!_.isEmpty(site)) {
102
+ query.site = site;
103
+ }
104
+ return authedFunction({
105
+ method: "GET",
106
+ url: getUrl("users", "invite/get", query),
107
+ });
108
+ },
109
+ generateInviteCode: (userId, type, site) => {
110
+ const data = {};
111
+ if (!_.isEmpty(userId)) {
112
+ data.userId = userId;
113
+ }
114
+ if (!_.isEmpty(type)) {
115
+ data.type = type;
116
+ }
117
+ if (!_.isEmpty(site)) {
118
+ data.site = site;
119
+ }
120
+ return authedFunction({
121
+ method: "POST",
122
+ url: getUrl("users", "invite/generate"),
123
+ data,
124
+ });
125
+ },
126
+ createInviteCode: (userId, site, userType, expiry) => {
127
+ return authedFunction({
128
+ method: "POST",
129
+ url: getUrl("users", "invite/update/add"),
130
+ data: { userId, site, userType, expiry },
131
+ });
132
+ },
133
+ editInviteCode: (code, userType, expiry) => {
134
+ return authedFunction({
135
+ method: "POST",
136
+ url: getUrl("users", "invite/update/edit"),
137
+ data: { code, userType, expiry },
138
+ });
139
+ },
140
+ deleteInviteCode: (code) => {
141
+ return authedFunction({
142
+ method: "POST",
143
+ url: getUrl("users", "invite/update/delete"),
144
+ data: { code },
145
+ });
146
+ },
147
+ getInviteCodes: (site, excludeFamily = false) => {
148
+ const action = excludeFamily ? "excludeFamily" : "all";
149
+ return authedFunction({
150
+ method: "GET",
151
+ url: getUrl("users", `invite/get/${action}`, { site }),
152
+ });
153
+ },
154
+ getInviteCodeByCode: (code) => {
155
+ return authedFunction({
156
+ method: "GET",
157
+ url: getUrl("users", "invite/get/code", { code }),
158
+ });
159
+ },
160
+ updateProfile: (input) => {
161
+ return authedFunction({
162
+ method: "POST",
163
+ url: getUrl("users", "updateProfile"),
164
+ data: {
165
+ details: input,
166
+ },
167
+ });
168
+ },
169
169
  };
@@ -1,35 +1,35 @@
1
- import Config from '../config';
2
- import { authedFunction, unauthedFunction } from '../session';
3
- import { getUrl } from '../helper';
1
+ import Config from "../config";
2
+ import { authedFunction, unauthedFunction } from "../session";
3
+ import { getUrl } from "../helper";
4
4
 
5
5
  export const utilityActions = {
6
- getUpvotyToken: () => {
7
- return authedFunction({
8
- method: 'GET',
9
- url: getUrl('utility', 'upvoty/usertoken'),
10
- });
11
- },
12
- getBoardHash: () => {
13
- return authedFunction({
14
- method: 'GET',
15
- url: getUrl('utility', 'upvoty/boardhash'),
16
- });
17
- },
18
- getRoadmapHash: () => {
19
- return authedFunction({
20
- method: 'GET',
21
- url: getUrl('utility', 'upvoty/roadmap'),
22
- });
23
- },
24
- generateMake: (templateId, data) => {
25
- return unauthedFunction({
26
- method: 'POST',
27
- url: `https://api.make.cm/make/t/${templateId}/sync`,
28
- data,
29
- headers: {
30
- 'Content-Type': 'application/json',
31
- 'X-MAKE-API-KEY': Config.env.makeApiKey,
32
- },
33
- });
34
- },
6
+ getUpvotyToken: () => {
7
+ return authedFunction({
8
+ method: "GET",
9
+ url: getUrl("utility", "upvoty/usertoken"),
10
+ });
11
+ },
12
+ getBoardHash: () => {
13
+ return authedFunction({
14
+ method: "GET",
15
+ url: getUrl("utility", "upvoty/boardhash"),
16
+ });
17
+ },
18
+ getRoadmapHash: () => {
19
+ return authedFunction({
20
+ method: "GET",
21
+ url: getUrl("utility", "upvoty/roadmap"),
22
+ });
23
+ },
24
+ generateMake: (templateId, data) => {
25
+ return unauthedFunction({
26
+ method: "POST",
27
+ url: `https://api.make.cm/make/t/${templateId}/sync`,
28
+ data,
29
+ headers: {
30
+ "Content-Type": "application/json",
31
+ "X-MAKE-API-KEY": Config.env.makeApiKey,
32
+ },
33
+ });
34
+ },
35
35
  };
package/src/colours.js CHANGED
@@ -2,12 +2,12 @@
2
2
  // const COLOUR_2 = '#3179cb';
3
3
  // const COLOUR_3 = '#1bb7ee';
4
4
 
5
- const COLOUR_BRANDING_MAIN = '#4a57b7';
5
+ const COLOUR_BRANDING_MAIN = "#4a57b7";
6
6
  // const COLOUR_BRANDING_DARK = '#364196';
7
7
  // const COLOUR_BRANDING_LIGHT = '#597db4';
8
- const COLOUR_BRANDING_OFF = '#597db4';
9
- const COLOUR_BRANDING_ACTION = '#5c90df';
10
- const COLOUR_BRANDING_INACTIVE = '#dbddf1';
8
+ const COLOUR_BRANDING_OFF = "#597db4";
9
+ const COLOUR_BRANDING_ACTION = "#5c90df";
10
+ const COLOUR_BRANDING_INACTIVE = "#dbddf1";
11
11
 
12
12
  // const TEXT_DARKEST = '#262a2d';
13
13
  // const TEXT_DARK = '#262a2d';
@@ -16,11 +16,11 @@ const COLOUR_BRANDING_INACTIVE = '#dbddf1';
16
16
  // const TEXT_DARK_ALPHA10 = 'rgba(60, 60, 80, .1)';
17
17
  // const TEXT_MID = '#5a5a6e';
18
18
  // const TEXT_MID_ALPHA50 = 'rgba(90, 90, 110, .5)';
19
- const TEXT_LIGHT = '#717b81';
19
+ const TEXT_LIGHT = "#717b81";
20
20
  // const TEXT_SUPER_LIGHT = '#d2d9e5';
21
- const COLOUR_DUSK = '#536280';
22
- const COLOUR_DUSK_LIGHT = '#67758f';
23
- const COLOUR_DUSK_LIGHTER = '#a1afcc';
21
+ const COLOUR_DUSK = "#536280";
22
+ const COLOUR_DUSK_LIGHT = "#67758f";
23
+ const COLOUR_DUSK_LIGHTER = "#a1afcc";
24
24
 
25
25
  const LINEGREY = COLOUR_BRANDING_INACTIVE;
26
26
  // const BORDER_LINE_GREY = COLOUR_BRANDING_INACTIVE;
@@ -31,8 +31,8 @@ const LINEGREY = COLOUR_BRANDING_INACTIVE;
31
31
  // const COLOUR_BLUE_ALPHA10 = 'rgba(0, 131, 238, 0.1)';
32
32
  // const COLOUR_DARKBLUE = '#191e78';
33
33
  // const COLOUR_PURPLE = '#6e79c5';
34
- const COLOUR_RED = '#c02743';
35
- const COLOUR_GREEN = '#00cc9c';
34
+ const COLOUR_RED = "#c02743";
35
+ const COLOUR_GREEN = "#00cc9c";
36
36
  // const COLOUR_TANGERINE = '#ff8c75';
37
37
  // const COLOUR_CITRON = '#bdbd27';
38
38
  // const COLOUR_GRAPEFRUIT = '#ff6363';
@@ -42,38 +42,40 @@ const COLOUR_GREEN = '#00cc9c';
42
42
  // const COLOUR_NAV_GREY = '#f6f6f6';
43
43
  // const COLOUR_TRANSPARENT = 'rgba(0,0,0,0)';
44
44
  // const COLOUR_SIDEBAR = '#303030';
45
- const COLOUR_LIGHTGREY = '#8695b2';
45
+ const COLOUR_LIGHTGREY = "#8695b2";
46
46
 
47
47
  const INACTIVE_TEXT = COLOUR_LIGHTGREY;
48
48
 
49
- const COLOUR_BRANDING_APP = '#4a57b7';
49
+ const COLOUR_BRANDING_APP = "#4a57b7";
50
50
 
51
51
  const hexToRGB = (hex) => {
52
- // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
53
- const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
54
- hex = hex.replace(shorthandRegex, (m, r, g, b) => {
55
- return r + r + g + g + b + b;
56
- });
52
+ // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
53
+ const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
54
+ hex = hex.replace(shorthandRegex, (m, r, g, b) => {
55
+ return r + r + g + g + b + b;
56
+ });
57
57
 
58
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
59
- return result
60
- ? {
61
- r: parseInt(result[1], 16),
62
- g: parseInt(result[2], 16),
63
- b: parseInt(result[3], 16),
64
- }
65
- : null;
58
+ const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
59
+ return result
60
+ ? {
61
+ r: parseInt(result[1], 16),
62
+ g: parseInt(result[2], 16),
63
+ b: parseInt(result[3], 16),
64
+ }
65
+ : null;
66
66
  };
67
67
 
68
68
  const hexToRGBAstring = (hex, opacity) => {
69
- // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
70
- const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
71
- hex = hex.replace(shorthandRegex, (m, r, g, b) => {
72
- return r + r + g + g + b + b;
73
- });
69
+ // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
70
+ const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
71
+ hex = hex.replace(shorthandRegex, (m, r, g, b) => {
72
+ return r + r + g + g + b + b;
73
+ });
74
74
 
75
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
76
- return result ? `rgba(${parseInt(result[1], 16)}, ${parseInt(result[2], 16)}, ${parseInt(result[3], 16)}, ${opacity})` : null;
75
+ const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
76
+ return result
77
+ ? `rgba(${parseInt(result[1], 16)}, ${parseInt(result[2], 16)}, ${parseInt(result[3], 16)}, ${opacity})`
78
+ : null;
77
79
  };
78
80
 
79
81
  // const pctBtwnColours = (c1, c2, percentage) => {
@@ -86,49 +88,49 @@ const hexToRGBAstring = (hex, opacity) => {
86
88
  // };
87
89
 
88
90
  export {
89
- // COLOUR_1,
90
- // COLOUR_2,
91
- // COLOUR_3,
92
- // TEXT_DARKEST,
93
- // TEXT_DARK,
94
- // TEXT_DARK_ALPHA50,
95
- // TEXT_DARK_ALPHA20,
96
- // TEXT_DARK_ALPHA10,
97
- // TEXT_MID,
98
- // TEXT_MID_ALPHA50,
99
- TEXT_LIGHT,
100
- // TEXT_SUPER_LIGHT,
101
- COLOUR_DUSK,
102
- COLOUR_DUSK_LIGHT,
103
- COLOUR_DUSK_LIGHTER,
104
- LINEGREY,
105
- // BORDER_LINE_GREY,
106
- // COLOUR_TEAL,
107
- // COLOUR_TEAL_ALPHA50,
108
- // COLOUR_BLUE,
109
- // COLOUR_BLUE_ALPHA10,
110
- // COLOUR_DARKBLUE,
111
- // COLOUR_PURPLE,
112
- COLOUR_RED,
113
- // COLOUR_TANGERINE,
114
- // COLOUR_CITRON,
115
- // COLOUR_GRAPEFRUIT,
116
- // DARK_OVERLAY,
117
- hexToRGB,
118
- hexToRGBAstring,
119
- // pctBtwnColours,
120
- // FACEBOOK_BLUE,
121
- // COLOUR_NAV_GREY,
122
- // COLOUR_TRANSPARENT,
123
- // COLOUR_SIDEBAR,
124
- COLOUR_BRANDING_MAIN,
125
- COLOUR_BRANDING_OFF,
126
- // COLOUR_BRANDING_LIGHT,
127
- // COLOUR_BRANDING_DARK,
128
- COLOUR_BRANDING_ACTION,
129
- COLOUR_GREEN,
130
- INACTIVE_TEXT,
131
- COLOUR_LIGHTGREY,
132
- COLOUR_BRANDING_APP,
133
- COLOUR_BRANDING_INACTIVE,
91
+ // COLOUR_1,
92
+ // COLOUR_2,
93
+ // COLOUR_3,
94
+ // TEXT_DARKEST,
95
+ // TEXT_DARK,
96
+ // TEXT_DARK_ALPHA50,
97
+ // TEXT_DARK_ALPHA20,
98
+ // TEXT_DARK_ALPHA10,
99
+ // TEXT_MID,
100
+ // TEXT_MID_ALPHA50,
101
+ TEXT_LIGHT,
102
+ // TEXT_SUPER_LIGHT,
103
+ COLOUR_DUSK,
104
+ COLOUR_DUSK_LIGHT,
105
+ COLOUR_DUSK_LIGHTER,
106
+ LINEGREY,
107
+ // BORDER_LINE_GREY,
108
+ // COLOUR_TEAL,
109
+ // COLOUR_TEAL_ALPHA50,
110
+ // COLOUR_BLUE,
111
+ // COLOUR_BLUE_ALPHA10,
112
+ // COLOUR_DARKBLUE,
113
+ // COLOUR_PURPLE,
114
+ COLOUR_RED,
115
+ // COLOUR_TANGERINE,
116
+ // COLOUR_CITRON,
117
+ // COLOUR_GRAPEFRUIT,
118
+ // DARK_OVERLAY,
119
+ hexToRGB,
120
+ hexToRGBAstring,
121
+ // pctBtwnColours,
122
+ // FACEBOOK_BLUE,
123
+ // COLOUR_NAV_GREY,
124
+ // COLOUR_TRANSPARENT,
125
+ // COLOUR_SIDEBAR,
126
+ COLOUR_BRANDING_MAIN,
127
+ COLOUR_BRANDING_OFF,
128
+ // COLOUR_BRANDING_LIGHT,
129
+ // COLOUR_BRANDING_DARK,
130
+ COLOUR_BRANDING_ACTION,
131
+ COLOUR_GREEN,
132
+ INACTIVE_TEXT,
133
+ COLOUR_LIGHTGREY,
134
+ COLOUR_BRANDING_APP,
135
+ COLOUR_BRANDING_INACTIVE,
134
136
  };
@@ -1,27 +1,36 @@
1
- import React, { Component } from 'react';
2
- import FontAwesome from 'react-fontawesome';
1
+ import React, { Component } from "react";
2
+ import FontAwesome from "react-fontawesome";
3
3
 
4
4
  class AddButton extends Component {
5
- getClasses() {
6
- let classes = 'addButton';
7
- if (this.props.inactive) {
8
- classes += ' addButton--inactive';
9
- }
10
- return classes;
11
- }
5
+ getClasses() {
6
+ let classes = "addButton";
7
+ if (this.props.inactive) {
8
+ classes += " addButton--inactive";
9
+ }
10
+ return classes;
11
+ }
12
12
 
13
- renderIcon() {
14
- return <FontAwesome className="addButton__icon" name={this.props.icon || 'plus'} />;
15
- }
13
+ renderIcon() {
14
+ return (
15
+ <FontAwesome
16
+ className="addButton__icon"
17
+ name={this.props.icon || "plus"}
18
+ />
19
+ );
20
+ }
16
21
 
17
- render() {
18
- return (
19
- <div style={this.props.style} onClick={this.props.onClick} className={this.getClasses()}>
20
- <div className="addButton__text">{this.props.text}</div>
21
- <div className="addButton__right">{this.renderIcon()}</div>
22
- </div>
23
- );
24
- }
22
+ render() {
23
+ return (
24
+ <div
25
+ style={this.props.style}
26
+ onClick={this.props.onClick}
27
+ className={this.getClasses()}
28
+ >
29
+ <div className="addButton__text">{this.props.text}</div>
30
+ <div className="addButton__right">{this.renderIcon()}</div>
31
+ </div>
32
+ );
33
+ }
25
34
  }
26
35
 
27
36
  export { AddButton };