diff --git a/common/app/routes/Challenges/Solution-Input.jsx b/common/app/routes/Challenges/Solution-Input.jsx index f5a4601f19..c6be18f8dc 100644 --- a/common/app/routes/Challenges/Solution-Input.jsx +++ b/common/app/routes/Challenges/Solution-Input.jsx @@ -10,10 +10,15 @@ const propTypes = { export default function SolutionInput({ solution, placeholder }) { const validationState = getValidationState(solution); + return ( { - validationState === 'error' ? - Make sure you provide a proper URL. : - null + validationState === 'error' && + Make sure you provide a proper URL. + } + { + validationState === 'glitch-warning' && + + Make sure you have entered a shareable URL + (e.g. "https://green-camper.glitch.me", not + "https://glitch.com/#!/edit/green-camper".) + } ); diff --git a/common/app/utils/form.js b/common/app/utils/form.js index 85232e4201..c96f4477f9 100644 --- a/common/app/utils/form.js +++ b/common/app/utils/form.js @@ -65,6 +65,10 @@ export function getValidationState(field) { return null; } + if ((/https?:\/\/glitch\.com\/edit\/#!\/.*/g).test(field.value)) { + return 'glitch-warning'; + } + return field.error ? 'error' : 'success';