File tree 1 file changed +24
-5
lines changed
1 file changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -124,15 +124,34 @@ function Logout() {
124
124
}
125
125
126
126
function App ( ) {
127
- const identity = useNetlifyIdentity (
128
- // TODO: CHANGE THIS URL IF YOU ARE USING A DIFFERENT NETLIFY INSTANCE
129
- 'https://festive-nightingale-47f180.netlify.com'
130
- // TODO: CHANGE THIS URL IF YOU ARE USING A DIFFERENT NETLIFY INSTANCE
131
- ) ;
127
+ // TODO: CHANGE THIS URL IF YOU ARE USING A DIFFERENT NETLIFY INSTANCE
128
+ // e.g. 'https://unruffled-roentgen-04c3b8.netlify.com'
129
+ const [ url , setUrl ] = React . useState ( window . location . origin ) ;
130
+ const handler = e => setUrl ( e . target . value ) ;
131
+ const identity = useNetlifyIdentity ( url ) ;
132
132
return (
133
133
< IdentityContext . Provider value = { identity } >
134
134
< div className = "App" >
135
135
< h1 > Netlify Identity + Reach Router demo</ h1 >
136
+ < label >
137
+ < a href = "https://www.netlify.com/docs/identity/" > Netlify Identity</ a > { ' ' }
138
+ Instance:{ ' ' }
139
+ < input
140
+ type = "text"
141
+ placeholder = "your instance here e.g. https://unruffled-roentgen-04c3b8.netlify.com"
142
+ value = { url }
143
+ onChange = { handler }
144
+ size = { 50 }
145
+ />
146
+ { window . location . hostname === 'localhost' ? (
147
+ < pre > WARNING: this demo doesn't work on localhost</ pre >
148
+ ) : (
149
+ < pre >
150
+ your instance here e.g.
151
+ https://unruffled-roentgen-04c3b8.netlify.com
152
+ </ pre >
153
+ ) }
154
+ </ label >
136
155
< Nav />
137
156
< Router >
138
157
< Home path = "/" />
You can’t perform that action at this time.
0 commit comments