瀏覽代碼

update folder structure

* move locales folder
RoyLiu 4 年之前
父節點
當前提交
6185373e5b

+ 1 - 1
components/DeleteDialog/index.tsx

@@ -42,7 +42,7 @@ const index: React.FC<Props> = ({
         </Button>
       </BtnWrapper>
     </Dialog>
-  )
+  );
 };
 
 export default index;

+ 22 - 10
components/Icon/styled.ts

@@ -18,10 +18,20 @@ export const IconWrapper = styled('div')<{isHover: boolean; isDisabled: boolean
     [data-status='hover'] {
       opacity: 0;
       position: absolute;
+      top: 0;
+      left: 0;
+      right: 0;
+      bottom: 0;
+      margin: auto;
     }
     [data-status='active'] {
       opacity: 0;
       position: absolute;
+      top: 0;
+      left: 0;
+      right: 0;
+      bottom: 0;
+      margin: auto;
     }
   ` : css`
     cursor: pointer;
@@ -37,6 +47,7 @@ export const IconWrapper = styled('div')<{isHover: boolean; isDisabled: boolean
       top: 0;
       left: 0;
       right: 0;
+      bottom: 0;
       margin: auto;
     }
     [data-status='active'] {
@@ -46,20 +57,21 @@ export const IconWrapper = styled('div')<{isHover: boolean; isDisabled: boolean
       top: 0;
       left: 0;
       right: 0;
+      bottom: 0;
       margin: auto;
     }
-  `)}
 
-  ${props => (props.isHover ? css`
-    :hover {
-      [data-status='hover'] {
-        opacity: 1;
+    ${props.isHover ? css`
+      :hover {
+        [data-status='hover'] {
+          opacity: 1;
+        }
+        [data-status='normal'] {
+          opacity: 0;
+        }
       }
-      [data-status='normal'] {
-        opacity: 0;
-      }
-    }
-  ` : null)}
+    ` : null}
+  `)}
 `;
 
 export const ClickZone = styled.div`

+ 2 - 2
components/WatermarkImageSelector/index.tsx

@@ -15,7 +15,7 @@ const ImageSelector: React.FC<Props> = ({
   t,
   onChange,
 }: Props): React.ReactElement => {
-  const handleClick = () => {
+  const handleClick = (): void => {
     uploadFile('.png,.jpg,.jpeg,.svg')
       .then((urlData) => {
         onChange(urlData);
@@ -33,7 +33,7 @@ const ImageSelector: React.FC<Props> = ({
         {t('selectImage')}
       </Button>
     </ContentWrapper>
-  )
+  );
 };
 
 export default ImageSelector;

+ 0 - 1
helpers/annotation.ts

@@ -1,4 +1,3 @@
-import _ from 'lodash';
 import { v4 as uuidv4 } from 'uuid';
 
 import { ANNOTATION_TYPE } from '../constants';

+ 10 - 10
i18n.js

@@ -2,16 +2,16 @@ import i18n from 'i18next';
 import { initReactI18next } from 'react-i18next';
 import LanguageDetector from 'i18next-browser-languagedetector';
 
-import metaEN from './public/locales/en/meta.json';
-import metaTW from './public/locales/zh-tw/meta.json';
-import sidebarEN from './public/locales/en/sidebar.json';
-import sidebarTW from './public/locales/zh-tw/sidebar.json';
-import toolbarEN from './public/locales/en/toolbar.json';
-import toolbarTW from './public/locales/zh-tw/toolbar.json';
-import dialogEN from './public/locales/en/dialog.json';
-import dialogTW from './public/locales/zh-tw/dialog.json';
-import toastEN from './public/locales/en/toast.json';
-import toastTW from './public/locales/zh-tw/toast.json';
+import metaEN from './public/static/locales/en/meta.json';
+import metaTW from './public/static/locales/zh-tw/meta.json';
+import sidebarEN from './public/static/locales/en/sidebar.json';
+import sidebarTW from './public/static/locales/zh-tw/sidebar.json';
+import toolbarEN from './public/static/locales/en/toolbar.json';
+import toolbarTW from './public/static/locales/zh-tw/toolbar.json';
+import dialogEN from './public/static/locales/en/dialog.json';
+import dialogTW from './public/static/locales/zh-tw/dialog.json';
+import toastEN from './public/static/locales/en/toast.json';
+import toastTW from './public/static/locales/zh-tw/toast.json';
 
 const resources = {
   en: {

+ 1 - 1
package.json

@@ -4,7 +4,7 @@
   "scripts": {
     "dev": "next -p 8080",
     "build": "next build",
-    "start": "NODE_ENV=production node server.js",
+    "start": "NODE_ENV=production next start",
     "export": "NODE_ENV=production ENV=production npm run build && next export",
     "lint": "eslint . --ext .ts,.tsx",
     "test": "jest --config=./config/jest.config.js"

+ 0 - 1
pages/_app.js

@@ -5,7 +5,6 @@ import { StoreProvider } from '../store';
 
 import '../i18n';
 import { GlobalStyle } from '../global/styled';
-
 class MainApp extends App {
   render() {
     const {

public/locales/en/dialog.json → public/static/locales/en/dialog.json


public/locales/en/meta.json → public/static/locales/en/meta.json


public/locales/en/sidebar.json → public/static/locales/en/sidebar.json


public/locales/en/toast.json → public/static/locales/en/toast.json


public/locales/en/toolbar.json → public/static/locales/en/toolbar.json


public/locales/zh-tw/dialog.json → public/static/locales/zh-tw/dialog.json


public/locales/zh-tw/meta.json → public/static/locales/zh-tw/meta.json


public/locales/zh-tw/sidebar.json → public/static/locales/zh-tw/sidebar.json


public/locales/zh-tw/toast.json → public/static/locales/zh-tw/toast.json


public/locales/zh-tw/toolbar.json → public/static/locales/zh-tw/toolbar.json