eletrotupi / tcc/ commit / 22ce11e

frontend: use the Button loading prop instead of isLoading

Pedro Lucas Porcellis porcellis@eletrotupi.com · 12 days ago 22ce11e7f70ff2faf4796eef6498cd1ec65bbd31 Browse files
Parents 13a51f6
Changed files
5
Additions
+7
Deletions
-7
frontend/app/entry/[id].tsx
1 1
import { useState, useEffect, use } from "react";
2 2
import {
3 3
  StyleSheet,
4 4
  View,
5 5
  ScrollView,
286 286
        {/* Delete */}
287 287
        <View style={styles.section}>
288 288
          <Text style={styles.sectionLabel}>GESTÃO DO REGISTRO</Text>
289 289
          <Button
290 290
            variant="danger"
291 -
            isLoading={deleteMoodEntry.isPending}
291 +
            loading={deleteMoodEntry.isPending}
292 292
            disabled={!canDelete || deleteMoodEntry.isPending}
293 293
            onPress={handleDelete}
294 294
            title={deleteButtonMsg()}
295 295
          />
296 296

440 440
    height: "100%",
441 441
    borderRadius: 99,
442 442
  },
443 443

444 444
});
frontend/app/sleep/[id].tsx
1 1
import { useState, useEffect, use } from "react";
2 2
import {
3 3
  StyleSheet,
4 4
  View,
5 5
  ScrollView,
134 134
        {/* Delete */}
135 135
        <View style={styles.section}>
136 136
          <Text style={styles.sectionLabel}>GESTÃO DO REGISTRO</Text>
137 137
          <Button
138 138
            variant="outline"
139 -
            isLoading={false}
139 +
            loading={false}
140 140
            disabled={!canDelete}
141 141
            onPress={() => router.push(`/sleep/edit/${sleepRecord.id}`)}
142 142
            title="Editar Registro"
143 143
          />
144 144

145 145
          <Button
146 146
            variant="danger"
147 -
            isLoading={deleteSleepRecord.isPending}
147 +
            loading={deleteSleepRecord.isPending}
148 148
            disabled={!canDelete || deleteSleepRecord.isPending}
149 149
            onPress={handleDelete}
150 150
            title={deleteButtonMsg()}
151 151
          />
152 152

288 288
    color: Colors.light.textSecondary,
289 289
    fontStyle: "italic",
290 290
    padding: 4,
291 291
  },
292 292
});
frontend/app/sleep/edit/[id].tsx
1 1
import {
2 2
  View,
3 3
  StyleSheet,
4 4
  KeyboardAvoidingView,
5 5
  ScrollView,
118 118
          </Card>
119 119

120 120
          <Button
121 121
            title="Salvar Alterações"
122 122
            onPress={save}
123 -
            isLoading={updateSleepRecord.isPending}
123 +
            loading={updateSleepRecord.isPending}
124 124
            disabled={updateSleepRecord.isPending}
125 125
          />
126 126
        </View>
127 127
      </ScrollView>
128 128
    </KeyboardAvoidingView>
172 172
    flex: 1,
173 173
    justifyContent: "center",
174 174
    alignItems: "center",
175 175
  },
176 176
});
frontend/app/triggers/[id].tsx
1 1
import { useState, useEffect, use } from "react";
2 2
import {
3 3
  StyleSheet,
4 4
  View,
5 5
  ScrollView,
271 271
        {/* Delete */}
272 272
        <View style={styles.section}>
273 273
          <Text style={styles.sectionLabel}>GESTÃO DO REGISTRO</Text>
274 274
          <Button
275 275
            variant="outline"
276 -
            isLoading={false}
276 +
            loading={false}
277 277
            disabled={!canDelete}
278 278
            onPress={() => router.push(`/triggers/edit/${trigger.id}`)}
279 279
            title="Editar Registro"
280 280
          />
281 281
          <Button
282 282
            variant="danger"
283 -
            isLoading={deleteTrigger.isPending}
283 +
            loading={deleteTrigger.isPending}
284 284
            disabled={!canDelete || deleteTrigger.isPending}
285 285
            onPress={handleDelete}
286 286
            title={deleteButtonMsg()}
287 287
          />
288 288

435 435
  impactFill: {
436 436
    height: "100%",
437 437
    borderRadius: 99,
438 438
  },
439 439
});
frontend/app/triggers/edit/[id].tsx
1 1
import {
2 2
  View,
3 3
  StyleSheet,
4 4
  KeyboardAvoidingView,
5 5
  ScrollView,
120 120
          </Section>
121 121

122 122
          <Button
123 123
            title="Salvar Alterações"
124 124
            onPress={save}
125 -
            isLoading={updateTrigger.isPending}
125 +
            loading={updateTrigger.isPending}
126 126
            disabled={updateTrigger.isPending}
127 127
          />
128 128
        </View>
129 129
      </ScrollView>
130 130
    </KeyboardAvoidingView>
175 175
    flex: 1,
176 176
    justifyContent: "center",
177 177
    alignItems: "center",
178 178
  },
179 179
});