auto update templates
This commit is contained in:
@@ -194,3 +194,20 @@ export const modules = [
|
||||
|
||||
}))
|
||||
]
|
||||
|
||||
fetch("https://openart.ai/api/public/templates/list").then(res=>res.json()).then(res=>{
|
||||
|
||||
res.map(template => {
|
||||
const t = ({
|
||||
id: template.id,
|
||||
title: template.name,
|
||||
description: template.description,
|
||||
type: 'template',
|
||||
thumbnail: template.thumbnails[0].url,
|
||||
categories: [categories[1]],
|
||||
})
|
||||
if(!modules.find(m=>m.id===t.id)){
|
||||
modules.push(t)
|
||||
}
|
||||
}
|
||||
)})
|
||||
|
||||
+210
-2
File diff suppressed because one or more lines are too long
+3
-16
@@ -1,23 +1,10 @@
|
||||
import React, {useState} from 'react';
|
||||
import React, {useEffect, useState} from 'react';
|
||||
import {Dialog} from "@headlessui/react";
|
||||
import logo from "./logo.png";
|
||||
import Draggable from "react-draggable";
|
||||
import {Loader} from "react-feather";
|
||||
// moduleItem.querySelector('button').addEventListener('click', () => {
|
||||
// LearnModal.get().close()
|
||||
// if(module.initialWorkflow){
|
||||
// app.loadGraphData(JSON.parse(module.initialWorkflow))
|
||||
// }
|
||||
// if(module.type === 'lesson') {
|
||||
// const keyframesFunctions = {}
|
||||
// if(module.keyframesWorkflows){
|
||||
// for (let keyframe in module.keyframesWorkflows) {
|
||||
// const parsedWorkflow = JSON.parse(module.keyframesWorkflows[keyframe])
|
||||
// keyframesFunctions[keyframe] = ()=> app.loadGraphData(parsedWorkflow);
|
||||
// }
|
||||
// }
|
||||
// startVideo(module.title,module.videoId,keyframesFunctions)
|
||||
// }
|
||||
import {categories} from "../../javascript/data";
|
||||
|
||||
function LearnDialog({close, startVideo}) {
|
||||
const [selectedCategory,setSelectedCategory] = useState(window.data.categories[0])
|
||||
const [loading,setLoading] = useState(false)
|
||||
|
||||
Reference in New Issue
Block a user