Merge remote-tracking branch 'origin/main' into Rejig-database-schema
This commit is contained in:
@@ -15,14 +15,14 @@ export const schema = gql`
|
|||||||
|
|
||||||
input CreateUserInput {
|
input CreateUserInput {
|
||||||
email: String!
|
email: String!
|
||||||
issuer: String!
|
# issuer: String!
|
||||||
image: String
|
image: String
|
||||||
bio: String
|
bio: String
|
||||||
}
|
}
|
||||||
|
|
||||||
input UpdateUserInput {
|
input UpdateUserInput {
|
||||||
email: String
|
email: String
|
||||||
issuer: String
|
# issuer: String
|
||||||
image: String
|
image: String
|
||||||
bio: String
|
bio: String
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
web/public/favi2.jpg
Normal file
BIN
web/public/favi2.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@@ -117,3 +117,4 @@ function getCroppedImg(image, crop, fileName) {
|
|||||||
}, 'image/jpeg', 1);
|
}, 'image/jpeg', 1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useMutation, useFlash } from '@redwoodjs/web'
|
import { useMutation, useFlash } from '@redwoodjs/web'
|
||||||
import { Link, routes, navigate } from '@redwoodjs/router'
|
import { Link, routes, navigate } from '@redwoodjs/router'
|
||||||
|
import { Image as CloudinaryImage } from 'cloudinary-react'
|
||||||
const DELETE_USER_MUTATION = gql`
|
const DELETE_USER_MUTATION = gql`
|
||||||
mutation DeleteUserMutation($id: Int!) {
|
mutation DeleteUserMutation($id: Int!) {
|
||||||
deleteUser(id: $id) {
|
deleteUser(id: $id) {
|
||||||
@@ -72,7 +72,13 @@ const User = ({ user }) => {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Image</th>
|
<th>Image</th>
|
||||||
<td>{user.image}</td>
|
<td><CloudinaryImage
|
||||||
|
className="object-cover w-full rounded shadow"
|
||||||
|
cloudName="irevdev"
|
||||||
|
publicId={user.image}
|
||||||
|
width="300"
|
||||||
|
crop="scale"
|
||||||
|
/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Bio</th>
|
<th>Bio</th>
|
||||||
|
|||||||
@@ -6,10 +6,21 @@ import {
|
|||||||
TextField,
|
TextField,
|
||||||
Submit,
|
Submit,
|
||||||
} from '@redwoodjs/forms'
|
} from '@redwoodjs/forms'
|
||||||
|
import { useState } from 'react';
|
||||||
|
import { navigate, routes } from '@redwoodjs/router'
|
||||||
|
import { useFlash } from '@redwoodjs/web'
|
||||||
|
import ImageUploader from '../PartForm/ImageUploader'
|
||||||
const UserForm = (props) => {
|
const UserForm = (props) => {
|
||||||
const onSubmit = (data) => {
|
const { addMessage } = useFlash()
|
||||||
props.onSave(data, props?.user?.id)
|
// const [bio, setBio] = useState(props?.user?.bio)
|
||||||
|
const [imageUrl, setImageUrl] = useState(props?.user?.image)
|
||||||
|
const onSubmit = async (data, e) => {
|
||||||
|
|
||||||
|
await props.onSave({
|
||||||
|
...data,
|
||||||
|
image: imageUrl
|
||||||
|
}, props?.user?.id)
|
||||||
|
addMessage('User updated.', { classes: 'rw-flash-success' })
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -37,21 +48,7 @@ const UserForm = (props) => {
|
|||||||
validation={{ required: true }}
|
validation={{ required: true }}
|
||||||
/>
|
/>
|
||||||
<FieldError name="email" className="rw-field-error" />
|
<FieldError name="email" className="rw-field-error" />
|
||||||
|
<ImageUploader onImageUpload={({cloudinaryPublicId}) => setImageUrl(cloudinaryPublicId)} />
|
||||||
<Label
|
|
||||||
name="image"
|
|
||||||
className="rw-label"
|
|
||||||
errorClassName="rw-label rw-label-error"
|
|
||||||
>
|
|
||||||
Image
|
|
||||||
</Label>
|
|
||||||
<TextField
|
|
||||||
name="image"
|
|
||||||
defaultValue={props.user?.image}
|
|
||||||
className="rw-input"
|
|
||||||
errorClassName="rw-input rw-input-error"
|
|
||||||
/>
|
|
||||||
<FieldError name="image" className="rw-field-error" />
|
|
||||||
|
|
||||||
<Label
|
<Label
|
||||||
name="bio"
|
name="bio"
|
||||||
@@ -65,6 +62,7 @@ const UserForm = (props) => {
|
|||||||
defaultValue={props.user?.bio}
|
defaultValue={props.user?.bio}
|
||||||
className="rw-input"
|
className="rw-input"
|
||||||
errorClassName="rw-input rw-input-error"
|
errorClassName="rw-input rw-input-error"
|
||||||
|
validation={{ required: true }}
|
||||||
/>
|
/>
|
||||||
<FieldError name="bio" className="rw-field-error" />
|
<FieldError name="bio" className="rw-field-error" />
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,10 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<link rel="icon" type="image/png" href="/favicon.png" />
|
|
||||||
<title>CadHub</title>
|
<link rel="icon" type="image/png" href="/favi2.jpg" />
|
||||||
|
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Install Cascade Studio as a Progressive Web App for Offline Access
|
// Install Cascade Studio as a Progressive Web App for Offline Access
|
||||||
// This needs to be put before ANY HTTP Requests are made, so it can cache them.
|
// This needs to be put before ANY HTTP Requests are made, so it can cache them.
|
||||||
|
|||||||
BIN
web/src/layouts/MainLayout/Logo_2.jpg
Normal file
BIN
web/src/layouts/MainLayout/Logo_2.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.4 KiB |
@@ -5,6 +5,7 @@ import Tooltip from '@material-ui/core/Tooltip';
|
|||||||
|
|
||||||
import avatar from 'src/assets/harold.jpg'
|
import avatar from 'src/assets/harold.jpg'
|
||||||
import Svg from 'src/components/Svg'
|
import Svg from 'src/components/Svg'
|
||||||
|
import logo from 'src/layouts/MainLayout/Logo_2.jpg'
|
||||||
|
|
||||||
const MainLayout = ({ children }) => {
|
const MainLayout = ({ children }) => {
|
||||||
const { logIn, logOut, isAuthenticated } = useAuth()
|
const { logIn, logOut, isAuthenticated } = useAuth()
|
||||||
@@ -16,7 +17,9 @@ const MainLayout = ({ children }) => {
|
|||||||
<li>
|
<li>
|
||||||
<Link to={routes.home()}>
|
<Link to={routes.home()}>
|
||||||
<Tooltip title="We need a logo!" >
|
<Tooltip title="We need a logo!" >
|
||||||
<div className="h-10 w-10 bg-indigo-500 rounded-full" data-tip="hello world" data-place="bottom"></div>
|
|
||||||
|
<img src={logo} style={{marginLeft : '50px'}}/>
|
||||||
|
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user