Closed fruhnow closed 5 years ago
Neat, could you cleanup the login page and the login reducer code so it doens't include the server anymore?
Will do (probably this weekend :-) )
Is it meant to forward you to the login page once you hit enter? Cause currently it doesn't happen on my end
Is it meant to forward you to the login page once you hit enter? Cause currently it doesn't happen on my end
@Matt07211 No, its not as im not familiar with how routing works with react native. It just grabs the ServerInfo on the ButtonClick.
could you cleanup the login page and the login reducer code so it doens't include the server anymore?
@EraYaN after checking my changes i am not sure anymore if this PR is the right place to do changes to Login-Stuff. (Additionally, i couldnt test it as i cant route to the LoginPage atm.) Correct me if im wrong :-)
I spent a few hours attempting various things, before I came to the realisation that we have an example of how to do it already.
$ git diff
diff --git a/jellyfinclient/src/components/EntryComponent.js b/jellyfinclient/src/components/EntryComponent.js
index 232805e..3b915f2 100644
--- a/jellyfinclient/src/components/EntryComponent.js
+++ b/jellyfinclient/src/components/EntryComponent.js
@@ -8,6 +8,7 @@ import {
} from 'react-native';
import styles from './Style'
import { Formik } from 'formik';
+import {Link} from '../utilities/routing/index';
export default class EntryComponent extends Component {
@@ -62,10 +63,12 @@ export default class EntryComponent extends Component {
</View>
</View>
<View style={styles.loginInput}>
- <Button style={[styles.button]}
- title={this.state.connectButtonMessage}
- onPress={handleSubmit}
- />
+ <Link to={'/login'}>
+ <Button style={[styles.button]}
+ title={this.state.connectButtonMessage}
+ onPress={handleSubmit}
+ />
+ </Link>
</View>
</View>
)}
@fruhnow when I try to run your branch, I get a Module not found: Can't resolve 'events.js' in 'C:\Users\SurfOl\Desktop\Jellyfin\jellyfin-webng\jellyfinclient\node_modules\jellyfin-apiclient\src'
error.
This seems to be related to https://github.com/jellyfin/jellyfin-apiclient-javascript/commit/a99b272ca448a410f52711e73646ebce8d6fef1c
How do you work around that?
@fruhnow when I try to run your branch, I get a
Module not found: Can't resolve 'events.js' in 'C:\Users\SurfOl\Desktop\Jellyfin\jellyfin-webng\jellyfinclient\node_modules\jellyfin-apiclient\src'
error. This seems to be related to jellyfin/jellyfin-apiclient-javascript@a99b272 How do you work around that?
worked for me by yarn add events.js
CAUTION: Im blatantly new to react native / redux so there is probably something to comment on which I am really thankful for!
I added a (basic) server-connection-page which is served as the new default page.
After clicking on connect, a request to
of the given IP+Port is sent using the ApiClient. A reference for the ApiClient is added for that.
created with help of @Matt07211
Screenshot![Screenshot](https://matrix.org/_matrix/media/v1/download/matrix.org/qnIhDQNKmbRCpZijPkNhDiLM)