Refactor upload-image to image-upload component

This commit is contained in:
Barry Low committed 2018-09-28 17:31:19 -07:00
1 parent 2e21c13415
commit 5596f54864
4 files changed
+306 -22

No files matched your search

@@ -20,7 +20,8 @@ import GET_TEAMS_BY_OWNER from '../../../graphql/teams/GetTeamsByOwnerQuery'
import { checkGraphQLError } from '../../../utils/graphql-errors'
import { UploadImage } from '../../common'
import { ImageUpload } from '../../common'
import GET_AZURE_SAS from '../../graphql/teams/GetAzureSASMutation'
const styles = theme => ({
dialogContainer: {
@@ -111,11 +112,37 @@ export class ManageTeamEdit extends Component {
Edit Team Details
</DialogTitle>
<DialogContent>
<UploadImage
team={team}
authId={authId}
handleAvatar={this.handleAvatar}
handleBanner={this.handleBanner}
<ImageUpload
handleURL={this.handleBanner}
fileName={`${team.slug}-banner.jpg`}
containerName={team.slug}
existingImage={team.profile.banner}
cropContainer={{ x: 10, y: 10, width: 800, height: 200 }}
saveImageConfig={{
quality: 0.6,
maxWidth: 800,
maxHeight: 200,
autoRotate: true,
debug: true,
mimeType: 'image/jpeg'
}}
AZURE_SAS_QUERY={GET_AZURE_SAS}
/>
<ImageUpload
handleURL={this.handleAvatar}
fileName={`${team.slug}-avatar.jpg`}
containerName={team.slug}
existingImage={team.profile.avatar}
cropContainer={{ x: 10, y: 10, width: 200, height: 200 }}
saveImageConfig={{
quality: 0.6,
maxWidth: 200,
maxHeight: 200,
autoRotate: true,
debug: true,
mimeType: 'image/jpeg'
}}
AZURE_SAS_QUERY={GET_AZURE_SAS}
/>
<TextField
autoFocus