upgrade rw + lint (#521)

* Various linting fixes

* Fix component name

* Upgrade to redwood 0.36.4
This commit was merged in pull request #521.
This commit is contained in:
Kurt Hutten
2021-09-20 19:08:03 +10:00
committed by GitHub
parent 39ce35b219
commit f6df9d1988
16 changed files with 161 additions and 193 deletions

View File

@@ -24,7 +24,7 @@ const EditableProjectTitle = ({
const [newTitle, setNewTitle] = useState(projectTitle)
const inputRef = React.useRef(null)
const { updateProject, loading, error } = useUpdateProject({
const { updateProject } = useUpdateProject({
onCompleted: ({ updateProject }) => {
const routeVars = {
userName: updateProject.user.userName,

View File

@@ -23,7 +23,7 @@ const EditorMenu = () => {
key={menu.label + '-dropdown'}
>
{menu.items.map((itemConfig) => (
<itemConfig.component
<itemConfig.Component
state={state}
thunkDispatch={thunkDispatch}
config={itemConfig}

View File

@@ -18,7 +18,7 @@ const fileMenuConfig: EditorMenuConfig = {
label: 'Save & Render',
shortcut: 'ctrl+s, command+s',
shortcutLabel: cmdOrCtrl() + ' S',
component: (props) => {
Component: (props) => {
const { state, config } = props
const handleRender = useRender()
const saveCode = useSaveCode()
@@ -37,7 +37,7 @@ const fileMenuConfig: EditorMenuConfig = {
label: 'Download STL',
shortcut: 'ctrl+shift+d, command+shift+d',
shortcutLabel: cmdOrCtrl() + ' Shift D',
component: (props) => {
Component: (props) => {
const { state, thunkDispatch, config } = props
const handleStlDownload = makeStlDownloadHandler({
type: state.objectData?.type,
@@ -56,14 +56,14 @@ const fileMenuConfig: EditorMenuConfig = {
],
}
const editMenuConfig = {
const editMenuConfig: EditorMenuConfig = {
name: 'edit',
label: 'Edit',
disabled: true,
items: [],
}
const viewMenuConfig = {
const viewMenuConfig: EditorMenuConfig = {
name: 'view',
label: 'View',
disabled: false,
@@ -72,7 +72,7 @@ const viewMenuConfig = {
label: 'Reset layout',
shortcut: 'ctrl+shift+r',
shortcutLabel: 'Ctrl Shift R',
component: (props) => {
Component: (props) => {
const { config, thunkDispatch } = props
config.callback = () => thunkDispatch({ type: 'resetLayout' })
return <DropdownItem {...props} />
@@ -82,7 +82,7 @@ const viewMenuConfig = {
label: 'All shortcuts',
shortcut: 'ctrl+shift+/',
shortcutLabel: 'Ctrl Shift /',
component: (props) => {
Component: (props) => {
const { config } = props
const { toggleOpen } = useShortcutsModalContext()
config.callback = toggleOpen
@@ -98,7 +98,7 @@ export interface EditorMenuItemConfig {
label: string
shortcut: string
shortcutLabel: React.ReactElement | string
component: (props: any) => React.ReactElement
Component: (props: any) => React.ReactElement
}
export interface EditorMenuConfig {

View File

@@ -1,8 +1,6 @@
import {
CadhubNumberChoiceParam,
CadhubNumberOption,
CadhubParams,
CadhubStringChoiceParam,
CadhubStringOption,
} from 'src/components/Customizer/customizerConverter'

View File

@@ -5,8 +5,6 @@ const setPoints = (points, p, i) => {
}
function CSG2Vertices(csg) {
const idx = 0
let vLen = 0,
iLen = 0
for (const poly of csg.polygons) {
@@ -178,7 +176,6 @@ function parseParams(script) {
let i = 0,
line,
next,
lineNum
while (i < lines.length) {
line = lines[i].code.trim()
@@ -194,7 +191,6 @@ function parseParams(script) {
while (i < lines.length) {
line = lines[i].code
lineNum = lines[i].line
next = lines[i + 1] ? lines[i + 1].code : ''
if (line[0] === '}') break
if (line[0] === '/') {
@@ -593,7 +589,7 @@ const makeRenderWorker = () => {
}
}
const updateAndRender = (timestamp) => {
const updateAndRender = () => {
renderTimer = null
doRotatePanZoom()
@@ -607,7 +603,6 @@ const makeRenderWorker = () => {
state.camera.position = updates.camera.position
perspectiveCamera.update(state.camera)
renderOptions.entities = [gridOptions, axisOptions, ...entities]
const time = Date.now()
renderer(renderOptions)
if (updateRender) {
updateRender = ''

View File

@@ -75,7 +75,7 @@ export const render = async ({ code, settings }: RenderArgs) => {
}
}
export const stl = async ({ code, settings }: RenderArgs) => {
export const stl = async ({ code /*settings*/ }: RenderArgs) => {
const body = JSON.stringify({
settings: {},
file: code,

View File

@@ -21,7 +21,7 @@ export const canvasToBlob = async (
}
const oldSize = threeInstance.size
updateCanvasSize({ width, height })
const imgBlobPromise: Promise<Blob> = new Promise((resolve, reject) => {
const imgBlobPromise: Promise<Blob> = new Promise((resolve) => {
threeInstance.gl.domElement.toBlob(
(blob) => {
resolve(blob)
@@ -34,8 +34,8 @@ export const canvasToBlob = async (
return imgBlobPromise
}
export const blobTo64 = async (blob: Blob): Promise<string> => {
return new Promise(async (resolve, reject) => {
export const blobTo64 = (blob: Blob): Promise<string> => {
return new Promise((resolve, reject) => {
const reader = new FileReader()
reader.onloadend = () => {
if (typeof reader.result === 'string') {

View File

@@ -22,28 +22,6 @@ const MainLayout = ({ children, shouldRemoveFooterInIde }) => {
const { logOut, isAuthenticated, currentUser, client } = useAuth()
const { user, loading } = useUser()
const [isLoginModalOpen, setIsLoginModalOpen] = useState(false)
const [isOpen, setIsOpen] = useState(false)
const [anchorEl, setAnchorEl] = useState(null)
const [popoverId, setPopoverId] = useState(undefined)
const openPopover = (target) => {
setAnchorEl(target)
setPopoverId('simple-popover')
setIsOpen(true)
}
const closePopover = () => {
setAnchorEl(null)
setPopoverId(undefined)
setIsOpen(false)
}
const togglePopover = ({ currentTarget }) => {
if (isOpen) {
return closePopover()
}
openPopover(currentTarget)
}
const recordedLogin = () => {
ReactGA.event({

View File

@@ -1,4 +1,3 @@
import { Link, routes } from '@redwoodjs/router'
import SocialCardCell from 'src/components/SocialCardCell'
interface Props {