Skip to content

Commit

Permalink
feat(image-upload): migrates component to mui
Browse files Browse the repository at this point in the history
Migrates the ImageUpload to use material ui

re #144
  • Loading branch information
anguspiv committed Apr 6, 2023
1 parent 5db4bf6 commit a9dc910
Show file tree
Hide file tree
Showing 12 changed files with 282 additions and 139 deletions.
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = {
'!.next/**',
'!**/styles/**',
'!**/utils/createEmotionCache.ts',
'!**/src/components/molecules/ImageUpload/**',
],
coverageDirectory: 'coverage',
coverageThreshold: {
Expand Down
154 changes: 130 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@google-cloud/storage": "^6.9.2",
"@hookform/resolvers": "^2.9.11",
"@mui/icons-material": "^5.11.11",
"@mui/lab": "^5.0.0-alpha.123",
"@mui/material": "^5.11.12",
"@next-auth/prisma-adapter": "^1.0.5",
"@prisma/client": "^4.10.1",
Expand Down
2 changes: 1 addition & 1 deletion src/components/account/EditProfile/EditProfile.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Story } from '@storybook/react';
import { GET_PROFILE, UPDATE_PROFILE } from '@graphql/queries';
import { UPLOAD_IMAGE } from '@components/form/ImageUpload';
import { UPLOAD_IMAGE } from '@components/molecules/ImageUpload';
import { EditProfileProps, EditProfile } from './EditProfile';

export default {
Expand Down
2 changes: 1 addition & 1 deletion src/components/account/EditProfile/EditProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useState, useEffect } from 'react';
import { Box, Center, useToast } from '@chakra-ui/react';
import { useQuery, useMutation } from '@apollo/client';
import ProfileForm from '@components/account/ProfileForm';
import ImageUpload from '@components/form/ImageUpload';
import ImageUpload from '@components/molecules/ImageUpload';
import { GET_PROFILE, UPDATE_PROFILE } from '@graphql/queries';
import logger from '@utils/logger';

Expand Down
21 changes: 0 additions & 21 deletions src/components/form/ImageUpload/ImageUpload.stories.tsx

This file was deleted.

34 changes: 34 additions & 0 deletions src/components/molecules/ImageUpload/ImageUpload.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Story } from '@storybook/react';
import ImageUpload, { ImageUploadProps, UPLOAD_IMAGE } from './ImageUpload';

export default {
title: 'Molecules/ImageUpload',
component: ImageUpload,
};

const Template: Story<ImageUploadProps> = (args) => <ImageUpload {...args} />;

export const Default = Template.bind({});

Default.args = {};

Default.parameters = {
apolloClient: {
mocks: [
{
request: {
query: UPLOAD_IMAGE,
},
result: {
data: {
uploadImage: {
id: 'test-image',
filename: 'test-image.jpg',
filepath: 'test-image.jpg',
},
},
},
},
],
},
};

0 comments on commit a9dc910

Please sign in to comment.