Skip to content

Commit 7a6a8fe

Browse files
authored
Merge pull request #512 from bryanmontalvan/feature-assetReference
modelReference and textureReference merger
2 parents 1607655 + d7bd827 commit 7a6a8fe

16 files changed

Lines changed: 242 additions & 941 deletions

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#The client ID should NOT start with http or https! This will cause authentication failure!
2-
REACT_APP_GOOGLE_CLIENTID=<Required for authenticting with the backend, get this from a team member>
2+
REACT_APP_GOOGLE_CLIENTID=<Required for authenticting with the backend, get this from a team member>

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10.13
1+
10.13
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from "react";
22
import Header from "../structural/header/Header";
33
import Footer from "../structural/Footer";
4-
import ModelReferencePage from "../reference/ModelReferencePage";
4+
import AssetReferencePage from "../reference/AssetReferencePage";
55

66
import * as layoutTypes from "../../constants/LayoutTypes.js";
77

8-
export const ModelReference = ({ editor, editorActions, user, authActions, scene, sceneActions, projectActions, courseActions, projects, courses, match, collectionActions, collections }) => (
8+
export const AssetReference = ({ editor, editorActions, user, authActions, scene, sceneActions, projectActions, courseActions, projects, courses, match, collectionActions, collections }) => (
99
<div className="App">
1010
<Header
1111
logging={authActions}
@@ -23,13 +23,13 @@ export const ModelReference = ({ editor, editorActions, user, authActions, scene
2323
courses={courses}
2424
collectionActions={collectionActions}
2525
collections={collections}
26-
layoutType={layoutTypes.MODEL_REFERENCE}
26+
layoutType={layoutTypes.REFERENCE}
2727
/>
2828
<div className="row no-gutters">
29-
<ModelReferencePage />
29+
<AssetReferencePage />
3030
</div>
3131
<Footer />
3232
</div>
3333
);
3434

35-
export default ModelReference;
35+
export default AssetReference;

src/components/layouts/TextureReference.js

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import React from "react";
2+
import ModelTab from "./ModelReferenceTab";
3+
import TextureTab from "./TextureReferenceTab";
4+
5+
import {
6+
Tabs,
7+
Tab,
8+
Icon,
9+
Hidden,
10+
} from "@material-ui/core";
11+
12+
import "../../css/ModelReferencePage.css";
13+
14+
export default class AssetReference extends React.Component {
15+
16+
constructor(props) {
17+
super(props);
18+
this.state = {
19+
value: "a",
20+
};
21+
}
22+
23+
handleChange = (event, value) => {
24+
this.setState({ value });
25+
};
26+
27+
componentDidMount() {
28+
const qsa = new URLSearchParams(window.location.search);
29+
if (qsa.has("tab") && qsa.get("tab").toLowerCase() === "textures") {
30+
this.setState({ value: "b" });
31+
}
32+
}
33+
34+
render() {
35+
document.title = "Asset | MYR";
36+
return (
37+
<div id="modelReference-page">
38+
<Tabs
39+
id="modelReference-tabs"
40+
variant="fullWidth"
41+
value={this.state.value}
42+
onChange={this.handleChange} >
43+
<Tab
44+
icon={<Icon className="material-icons model">model</Icon>}
45+
label={
46+
<Hidden xsDown>
47+
<div>MODEL</div>
48+
</Hidden>
49+
}
50+
value='a' />
51+
<Tab
52+
icon={<Icon className="material-icons texture">texture</Icon>}
53+
label={
54+
<Hidden xsDown>
55+
<div>TEXTURE</div>
56+
</Hidden>
57+
}
58+
value='b' />
59+
</Tabs>
60+
{this.state.value === "a" &&
61+
<div style={{ marginTop: 0 }}>
62+
<ModelTab />
63+
</div>}
64+
{this.state.value === "b" &&
65+
<div style={{ marginTop: 0 }}>
66+
<TextureTab />
67+
</div>}
68+
</div>
69+
);
70+
}
71+
}

src/components/reference/ModelReference.js

Lines changed: 0 additions & 187 deletions
This file was deleted.

0 commit comments

Comments
 (0)