Skip to content

Commit 93f0acc

Browse files
Merge pull request #34 from offset-dev/develop
v0.1.0
2 parents 600744c + 5adcbd1 commit 93f0acc

File tree

21 files changed

+2547
-523
lines changed

21 files changed

+2547
-523
lines changed

.eslintrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@
33
"root": true,
44
"globals": {
55
"process": true
6+
},
7+
"plugins": ["prettier"],
8+
"rules": {
9+
"prettier/prettier": "error"
610
}
711
}

.prettierrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
endOfLine: 'lf',
3+
semi: true,
4+
singleQuote: true,
5+
tabWidth: 2,
6+
trailingComma: 'es5',
7+
printWidth: 100,
8+
arrowParens: 'always',
9+
};

admin/src/api.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
1-
import axiosInstance from "./utils/axiosInstance";
1+
import axiosInstance from './utils/axiosInstance';
22

33
const taskRequests = {
44
getData: async (date) => {
55
const data = await axiosInstance.get(`/calendar`, {
66
params: {
7-
date
8-
}
7+
date,
8+
},
99
});
10-
11-
return data;
10+
11+
return data;
1212
},
1313
getCollections: async () => {
1414
const data = await axiosInstance.get(`/calendar/settings/collections`);
15-
16-
return data;
15+
16+
return data;
17+
},
18+
getExtensions: async () => {
19+
const data = await axiosInstance.get(`/calendar/extensions`);
20+
21+
return data;
1722
},
1823
getSettings: async () => {
1924
const data = await axiosInstance.get(`/calendar/settings`);
20-
21-
return data;
25+
26+
return data;
2227
},
23-
setSettings: async data => {
28+
setSettings: async (data) => {
2429
return axiosInstance.post(`/calendar/settings`, data);
2530
},
2631
};

admin/src/components/illo.js

Lines changed: 56 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,61 @@
1-
import React from "react";
1+
import React from 'react';
22

33
function Illo() {
4-
return <svg width="159" height="88" viewBox="0 0 159 88" fill="none" xmlns="http://www.w3.org/2000/svg">
5-
<path
6-
fillRule="evenodd"
7-
clipRule="evenodd"
8-
d="M134.933 17.417C137.768 17.417 140.067 19.7153 140.067 22.5503C140.067 25.3854 137.768 27.6837 134.933 27.6837H105.6C108.435 27.6837 110.733 29.9819 110.733 32.817C110.733 35.6521 108.435 37.9503 105.6 37.9503H121.733C124.568 37.9503 126.867 40.2486 126.867 43.0837C126.867 45.9187 124.568 48.217 121.733 48.217H114.272C110.698 48.217 107.8 50.5153 107.8 53.3503C107.8 55.2404 109.267 56.9515 112.2 58.4837C115.035 58.4837 117.333 60.7819 117.333 63.617C117.333 66.4521 115.035 68.7503 112.2 68.7503H51.3333C48.4982 68.7503 46.2 66.4521 46.2 63.617C46.2 60.7819 48.4982 58.4837 51.3333 58.4837H22.7333C19.8982 58.4837 17.6 56.1854 17.6 53.3503C17.6 50.5153 19.8982 48.217 22.7333 48.217H52.0666C54.9017 48.217 57.2 45.9187 57.2 43.0837C57.2 40.2486 54.9017 37.9503 52.0666 37.9503H33.7333C30.8982 37.9503 28.6 35.6521 28.6 32.817C28.6 29.9819 30.8982 27.6837 33.7333 27.6837H63.0666C60.2316 27.6837 57.9333 25.3854 57.9333 22.5503C57.9333 19.7153 60.2316 17.417 63.0666 17.417H134.933ZM134.933 37.9503C137.768 37.9503 140.067 40.2486 140.067 43.0837C140.067 45.9187 137.768 48.217 134.933 48.217C132.098 48.217 129.8 45.9187 129.8 43.0837C129.8 40.2486 132.098 37.9503 134.933 37.9503Z"
9-
fill="#DBDBFA"
10-
/>
11-
<path
12-
fillRule="evenodd"
13-
clipRule="evenodd"
14-
d="M95.826 16.6834L102.647 66.4348L103.26 71.4261C103.458 73.034 102.314 74.4976 100.706 74.695L57.7621 79.9679C56.1542 80.1653 54.6906 79.0219 54.4932 77.4139L47.8816 23.5671C47.7829 22.7631 48.3546 22.0313 49.1586 21.9326C49.1637 21.932 49.1688 21.9313 49.1739 21.9307L52.7367 21.5311L95.826 16.6834ZM55.6176 21.208L58.9814 20.8306Z"
15-
fill="white"
16-
/>
17-
<path
18-
d="M55.6176 21.208L58.9814 20.8306M95.826 16.6834L102.647 66.4348L103.26 71.4261C103.458 73.034 102.314 74.4976 100.706 74.695L57.7621 79.9679C56.1542 80.1653 54.6906 79.0219 54.4932 77.4139L47.8816 23.5671C47.7829 22.7631 48.3546 22.0313 49.1586 21.9326C49.1637 21.932 49.1688 21.9313 49.1739 21.9307L52.7367 21.5311L95.826 16.6834Z"
19-
stroke="#7E7BF6"
20-
strokeWidth="2.5"
21-
/>
22-
<path
23-
fillRule="evenodd"
24-
clipRule="evenodd"
25-
d="M93.9695 19.8144L100.144 64.9025L100.699 69.4258C100.878 70.8831 99.8559 72.2077 98.416 72.3845L59.9585 77.1065C58.5185 77.2833 57.2062 76.2453 57.0272 74.7881L51.0506 26.112C50.9519 25.308 51.5236 24.5762 52.3276 24.4775L57.0851 23.8934"
26-
fill="#F0F0FF"
27-
/>
28-
<path
29-
fillRule="evenodd"
30-
clipRule="evenodd"
31-
d="M97.701 7.33301H64.2927C63.7358 7.33301 63.2316 7.55873 62.8667 7.92368C62.5017 8.28862 62.276 8.79279 62.276 9.34967V65.083C62.276 65.6399 62.5017 66.1441 62.8667 66.509C63.2316 66.874 63.7358 67.0997 64.2927 67.0997H107.559C108.116 67.0997 108.62 66.874 108.985 66.509C109.35 66.1441 109.576 65.6399 109.576 65.083V19.202C109.576 18.6669 109.363 18.1537 108.985 17.7755L99.1265 7.92324C98.7484 7.54531 98.2356 7.33301 97.701 7.33301Z"
32-
fill="white"
33-
stroke="#7F7CFA"
34-
strokeWidth="2.5"
35-
/>
36-
<path
37-
d="M98.026 8.17871V16.6833C98.026 17.8983 99.011 18.8833 100.226 18.8833H106.044"
38-
stroke="#807EFA"
39-
strokeWidth="2.5"
40-
strokeLinecap="round"
41-
strokeLinejoin="round"
42-
/>
43-
<path
44-
d="M70.1594 56.2838H89.2261M70.1594 18.8838H89.2261H70.1594ZM70.1594 27.6838H101.693H70.1594ZM70.1594 37.2171H101.693H70.1594ZM70.1594 46.7505H101.693H70.1594Z"
45-
stroke="#817FFA"
46-
strokeWidth="2.5"
47-
strokeLinecap="round"
48-
strokeLinejoin="round"
49-
/>
50-
</svg>
4+
return (
5+
<svg
6+
width="159"
7+
height="88"
8+
viewBox="0 0 159 88"
9+
fill="none"
10+
xmlns="http://www.w3.org/2000/svg"
11+
>
12+
<path
13+
fillRule="evenodd"
14+
clipRule="evenodd"
15+
d="M134.933 17.417C137.768 17.417 140.067 19.7153 140.067 22.5503C140.067 25.3854 137.768 27.6837 134.933 27.6837H105.6C108.435 27.6837 110.733 29.9819 110.733 32.817C110.733 35.6521 108.435 37.9503 105.6 37.9503H121.733C124.568 37.9503 126.867 40.2486 126.867 43.0837C126.867 45.9187 124.568 48.217 121.733 48.217H114.272C110.698 48.217 107.8 50.5153 107.8 53.3503C107.8 55.2404 109.267 56.9515 112.2 58.4837C115.035 58.4837 117.333 60.7819 117.333 63.617C117.333 66.4521 115.035 68.7503 112.2 68.7503H51.3333C48.4982 68.7503 46.2 66.4521 46.2 63.617C46.2 60.7819 48.4982 58.4837 51.3333 58.4837H22.7333C19.8982 58.4837 17.6 56.1854 17.6 53.3503C17.6 50.5153 19.8982 48.217 22.7333 48.217H52.0666C54.9017 48.217 57.2 45.9187 57.2 43.0837C57.2 40.2486 54.9017 37.9503 52.0666 37.9503H33.7333C30.8982 37.9503 28.6 35.6521 28.6 32.817C28.6 29.9819 30.8982 27.6837 33.7333 27.6837H63.0666C60.2316 27.6837 57.9333 25.3854 57.9333 22.5503C57.9333 19.7153 60.2316 17.417 63.0666 17.417H134.933ZM134.933 37.9503C137.768 37.9503 140.067 40.2486 140.067 43.0837C140.067 45.9187 137.768 48.217 134.933 48.217C132.098 48.217 129.8 45.9187 129.8 43.0837C129.8 40.2486 132.098 37.9503 134.933 37.9503Z"
16+
fill="#DBDBFA"
17+
/>
18+
<path
19+
fillRule="evenodd"
20+
clipRule="evenodd"
21+
d="M95.826 16.6834L102.647 66.4348L103.26 71.4261C103.458 73.034 102.314 74.4976 100.706 74.695L57.7621 79.9679C56.1542 80.1653 54.6906 79.0219 54.4932 77.4139L47.8816 23.5671C47.7829 22.7631 48.3546 22.0313 49.1586 21.9326C49.1637 21.932 49.1688 21.9313 49.1739 21.9307L52.7367 21.5311L95.826 16.6834ZM55.6176 21.208L58.9814 20.8306Z"
22+
fill="white"
23+
/>
24+
<path
25+
d="M55.6176 21.208L58.9814 20.8306M95.826 16.6834L102.647 66.4348L103.26 71.4261C103.458 73.034 102.314 74.4976 100.706 74.695L57.7621 79.9679C56.1542 80.1653 54.6906 79.0219 54.4932 77.4139L47.8816 23.5671C47.7829 22.7631 48.3546 22.0313 49.1586 21.9326C49.1637 21.932 49.1688 21.9313 49.1739 21.9307L52.7367 21.5311L95.826 16.6834Z"
26+
stroke="#7E7BF6"
27+
strokeWidth="2.5"
28+
/>
29+
<path
30+
fillRule="evenodd"
31+
clipRule="evenodd"
32+
d="M93.9695 19.8144L100.144 64.9025L100.699 69.4258C100.878 70.8831 99.8559 72.2077 98.416 72.3845L59.9585 77.1065C58.5185 77.2833 57.2062 76.2453 57.0272 74.7881L51.0506 26.112C50.9519 25.308 51.5236 24.5762 52.3276 24.4775L57.0851 23.8934"
33+
fill="#F0F0FF"
34+
/>
35+
<path
36+
fillRule="evenodd"
37+
clipRule="evenodd"
38+
d="M97.701 7.33301H64.2927C63.7358 7.33301 63.2316 7.55873 62.8667 7.92368C62.5017 8.28862 62.276 8.79279 62.276 9.34967V65.083C62.276 65.6399 62.5017 66.1441 62.8667 66.509C63.2316 66.874 63.7358 67.0997 64.2927 67.0997H107.559C108.116 67.0997 108.62 66.874 108.985 66.509C109.35 66.1441 109.576 65.6399 109.576 65.083V19.202C109.576 18.6669 109.363 18.1537 108.985 17.7755L99.1265 7.92324C98.7484 7.54531 98.2356 7.33301 97.701 7.33301Z"
39+
fill="white"
40+
stroke="#7F7CFA"
41+
strokeWidth="2.5"
42+
/>
43+
<path
44+
d="M98.026 8.17871V16.6833C98.026 17.8983 99.011 18.8833 100.226 18.8833H106.044"
45+
stroke="#807EFA"
46+
strokeWidth="2.5"
47+
strokeLinecap="round"
48+
strokeLinejoin="round"
49+
/>
50+
<path
51+
d="M70.1594 56.2838H89.2261M70.1594 18.8838H89.2261H70.1594ZM70.1594 27.6838H101.693H70.1594ZM70.1594 37.2171H101.693H70.1594ZM70.1594 46.7505H101.693H70.1594Z"
52+
stroke="#817FFA"
53+
strokeWidth="2.5"
54+
strokeLinecap="round"
55+
strokeLinejoin="round"
56+
/>
57+
</svg>
58+
);
5159
}
5260

5361
export default Illo;

admin/src/index.js

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {prefixPluginTranslations} from '@strapi/helper-plugin';
1+
import { prefixPluginTranslations } from '@strapi/helper-plugin';
22
import CalendarIcon from '@strapi/icons/Calendar';
33
import pluginPkg from '../../package.json';
44
import pluginId from './pluginId';
@@ -28,25 +28,28 @@ export default {
2828
// },
2929
],
3030
});
31-
app.createSettingSection({
32-
id: pluginId,
33-
intlLabel: {
34-
id: `${pluginId}.plugin.name`,
35-
defaultMessage: `${pluginId} Settings`,
36-
},
37-
}, [
31+
app.createSettingSection(
3832
{
33+
id: pluginId,
3934
intlLabel: {
4035
id: `${pluginId}.plugin.name`,
41-
defaultMessage: 'Settings',
42-
},
43-
id: 'settings',
44-
to: `/settings/${pluginId}`,
45-
Component: async () => {
46-
return import('./pages/settings');
36+
defaultMessage: `${pluginId} Settings`,
4737
},
4838
},
49-
]);
39+
[
40+
{
41+
intlLabel: {
42+
id: `${pluginId}.plugin.name`,
43+
defaultMessage: 'Settings',
44+
},
45+
id: 'settings',
46+
to: `/settings/${pluginId}`,
47+
Component: async () => {
48+
return import('./pages/settings');
49+
},
50+
},
51+
]
52+
);
5053
app.registerPlugin({
5154
id: pluginId,
5255
initializer: Initializer,
@@ -55,13 +58,12 @@ export default {
5558
});
5659
},
5760

58-
bootstrap() {
59-
},
60-
async registerTrads({locales}) {
61+
bootstrap() {},
62+
async registerTrads({ locales }) {
6163
const importedTrads = await Promise.all(
62-
locales.map(locale => {
64+
locales.map((locale) => {
6365
return import(`./translations/${locale}.json`)
64-
.then(({default: data}) => {
66+
.then(({ default: data }) => {
6567
return {
6668
data: prefixPluginTranslations(data, pluginId),
6769
locale,

0 commit comments

Comments
 (0)