@@ -8,16 +8,13 @@ import {
8
8
IonButton ,
9
9
IonCol ,
10
10
IonGrid ,
11
- IonInput ,
12
- IonInputPasswordToggle ,
13
11
IonItem ,
14
12
IonLabel ,
15
13
IonList ,
16
14
IonNote ,
17
15
IonPopover ,
18
16
IonRow ,
19
17
IonToggle ,
20
- IonButtons ,
21
18
IonSelectOption ,
22
19
IonSelect ,
23
20
getConfig ,
@@ -31,12 +28,10 @@ import { formatBytes } from "@/utils"
31
28
import { DonateButton , InfoBanners } from "@/components"
32
29
import { DeviceMode } from "@/types"
33
30
34
- const SettingsPage : React . FC < { hasUpdate : boolean ; onUpdate : ( ) => void } > = ( { hasUpdate, onUpdate } ) => {
31
+ const SettingsHomePage : React . FC < { hasUpdate : boolean ; onUpdate : ( ) => void } > = ( { hasUpdate, onUpdate } ) => {
35
32
const queryClient = useQueryClient ( )
36
33
const history = useHistory ( )
37
- const [ { username, token } , saveAuth , clearAuth ] = useAuth ( )
38
- const [ newUsername , setNewUsername ] = useState < string > ( username ?? "" )
39
- const [ newPassword , setNewPassword ] = useState < string > ( token ?? "" )
34
+ const [ { username } , _ , clearAuth ] = useAuth ( )
40
35
const [ storageInfo , setStorageInfo ] = useState < { usage : string ; quota : string } | undefined > ( )
41
36
const [ imageQuality , setImageQuality , clearImagequality ] = useSettings < boolean > ( "ImagesAreHQ" , false )
42
37
const [ deviceTheme , setDeviceTheme ] = useSettings < DeviceMode > ( "DeviceTheme" , "ios" )
@@ -55,13 +50,6 @@ const SettingsPage: React.FC<{ hasUpdate: boolean; onUpdate: () => void }> = ({
55
50
}
56
51
} , [ ] )
57
52
58
- const handleSave = ( ) => {
59
- saveAuth ( newUsername , newPassword )
60
- queryClient . clear ( )
61
- history . push ( "/" )
62
- window . location . reload ( )
63
- }
64
-
65
53
const deleteData = ( ) => {
66
54
queryClient . clear ( )
67
55
clearAuth ( )
@@ -90,39 +78,15 @@ const SettingsPage: React.FC<{ hasUpdate: boolean; onUpdate: () => void }> = ({
90
78
< IonHeader >
91
79
< IonToolbar >
92
80
< IonTitle > Settings</ IonTitle >
93
- < IonButtons slot = "end" >
94
- < IonButton strong = { true } onClick = { handleSave } >
95
- Save
96
- </ IonButton >
97
- </ IonButtons >
98
81
</ IonToolbar >
99
82
< InfoBanners />
100
83
</ IonHeader >
101
84
< IonContent className = "ion-padding" >
102
85
< IonList inset = { true } >
103
- < IonItem color = { lightMode } >
104
- < IonInput
105
- label = "Username"
106
- value = { newUsername }
107
- onIonChange = { ( e ) => setNewUsername ( `${ e . target . value } ` ) }
108
- />
109
- </ IonItem >
110
- < IonItem color = { lightMode } >
111
- < IonInput
112
- type = "password"
113
- label = "Token"
114
- value = { newPassword }
115
- onIonChange = { ( e ) => setNewPassword ( `${ e . target . value } ` ) }
116
- >
117
- < IonInputPasswordToggle slot = "end" />
118
- </ IonInput >
86
+ < IonItem color = { lightMode } button = { true } routerLink = "/settings/login" >
87
+ < IonLabel > Discogs { username ? `account (${ username } )` : "login" } </ IonLabel >
119
88
</ IonItem >
120
89
</ IonList >
121
- < IonNote color = "medium" class = "ion-margin-horizontal" style = { { display : "block" } } >
122
- Until OAuth is implemented, we currently use Access Token for authentication. To get your token,{ " " }
123
- < a href = "https://www.discogs.com/settings/developers" > visit the Developer page</ a > and copy your
124
- token, or click Generate if you do not have one.
125
- </ IonNote >
126
90
< IonList inset = { true } >
127
91
< IonItem color = { lightMode } >
128
92
< IonToggle checked = { imageQuality } onIonChange = { ( e ) => setImageQuality ( e . detail . checked ) } >
@@ -245,4 +209,4 @@ const SettingsPage: React.FC<{ hasUpdate: boolean; onUpdate: () => void }> = ({
245
209
)
246
210
}
247
211
248
- export default SettingsPage
212
+ export default SettingsHomePage
0 commit comments