-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/oculus go tlc #467
Changes from all commits
437a326
5001ccc
206e34a
33d37a2
fd28ad8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,12 @@ | |
<title>Enter Code | Hubs by Mozilla</title> | ||
<link href="https://fonts.googleapis.com/css?family=Zilla+Slab:300,300i,400,400i,700" rel="stylesheet"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | ||
|
||
<% if(NODE_ENV === "production") { %> | ||
<script src="https://cdn.rawgit.com/aframevr/aframe/1be48d9/dist/aframe-master.min.js" integrity="sha384-SXrfoMHbXpA5RZhIyhgaR6tQ764dDZsbFk3PiokC/tc0+NnW1yaYQMUzWtL06hnq" crossorigin="anonymous"></script> | ||
<% } else { %> | ||
<script src="https://cdn.rawgit.com/aframevr/aframe/1be48d9/dist/aframe-master.js" integrity="sha384-AmjDGOMbvTrrUFdeVWcBIlXRINIWnO8iwj/4VS21OWbYDsa/7nheOIyPAPJSkR6J" crossorigin="anonymous"></script> | ||
<% } %> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We really gotta get this into npm. |
||
</head> | ||
|
||
<body> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,16 +15,25 @@ const HUB_NAME_PATTERN = "^[A-Za-z0-9-'\":!@#$%^&*(),.?~ ]{4,64}$"; | |
class HubCreatePanel extends Component { | ||
static propTypes = { | ||
intl: PropTypes.object, | ||
environments: PropTypes.array | ||
environments: PropTypes.array, | ||
initialEnvironment: PropTypes.string | ||
}; | ||
|
||
constructor(props) { | ||
super(props); | ||
|
||
let environmentIndex = Math.floor(Math.random() * props.environments.length); | ||
|
||
if (props.initialEnvironment) { | ||
environmentIndex = props.environments.findIndex( | ||
e => e.name.toLowerCase() === props.initialEnvironment.toLowerCase() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like code like this that tries to complicatedly fuzzy match what the inputs were supposed to mean, because I think it adds complexity with the result of making it harder to remember how the code works and more complicated to document. I wouldn't have done it and I would spend the time to actively work to undo it later by identifying and canonicalizing the actual parameters people use. (This is a disagreement I have in other places in our code too, not just this one.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure what your use case is for setting the initial environment, but I would consider making an error message pop out here if you got an invalid input (i.e. an environment that doesn't exist) instead of having a mysterious failure down the line. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is intended for us to be able to tell the user study facilitators (perhaps verbally) how to initialize the landing page to a specific environment choice, and so I made it case insensitive (in part based upon the hilarious experiences of trying to get people to type "mediaTools=true" over the last couple of weeks and not getting the casing right) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IOW I think a case insensitive match here for the name of the environment is the proper UX for this parameter. |
||
); | ||
} | ||
|
||
this.state = { | ||
ready: false, | ||
name: generateHubName(), | ||
environmentIndex: Math.floor(Math.random() * props.environments.length), | ||
environmentIndex, | ||
// HACK: expand on small screens by default to ensure scene selection possible. | ||
// Eventually this could/should be done via media queries. | ||
expanded: window.innerWidth < 420 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're going to need to resolve a conflict with master here since
qs
became aURLSearchParams
.