Skip to content

Commit

Permalink
Detalhes finais
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraDark committed Jun 7, 2022
1 parent 50a6b30 commit 6d2ff9e
Show file tree
Hide file tree
Showing 35 changed files with 46 additions and 344 deletions.
17 changes: 17 additions & 0 deletions .expo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
> Why do I have a folder named ".expo" in my project?
The ".expo" folder is created when an Expo project is started using "expo start" command.

> What does the "packager-info.json" file contain?
The "packager-info.json" file contains port numbers and process PIDs that are used to serve the application to the mobile device/simulator.

> What does the "settings.json" file contain?
The "settings.json" file contains the server configuration that is used to serve the application manifest.

> Should I commit the ".expo" folder?
No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.

Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
9 changes: 9 additions & 0 deletions .expo/packager-info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"expoServerPort": 8081,
"packagerPort": 8081,
"packagerPid": null,
"expoServerNgrokUrl": null,
"packagerNgrokUrl": null,
"ngrokPid": null,
"webpackServerPort": null
}
10 changes: 10 additions & 0 deletions .expo/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"scheme": "com.dessa.studycards",
"hostType": "lan",
"lanType": "ip",
"devClient": true,
"dev": true,
"minify": false,
"urlRandomness": null,
"https": false
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 6 additions & 31 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
node_modules/
.expo/
dist/
npm-debug.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/

# macOS
.DS_Store

# @generated expo-cli sync-e7dcf75f4e856f7b6f3239b3f3a7dd614ee755a8
# The following patterns were generated by expo-cli

# OSX
#
.DS_Store
Expand Down Expand Up @@ -47,29 +29,22 @@ build/
.gradle
local.properties
*.iml
*.hprof

# node.js
#
node_modules/
package-lock.json
npm-debug.log
yarn-error.log
yarn.lock

# BUCK
buck-out/
\.buckd/
*.keystore
!debug.keystore

# Bundle artifacts
*.jsbundle

# CocoaPods
/ios/Pods/

# Expo
.expo/
web-build/
dist/
*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots

# @end expo-cli
*.jsbundle
11 changes: 4 additions & 7 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"expo": {
"name": "Study Cards",
"slug": "study-cards",
"platforms": [
"android"
],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
Expand All @@ -16,18 +19,12 @@
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#1a1a1a"
},
"package": "com.dessa.studycards"
},
"web": {
"favicon": "./assets/favicon.png"
"package": "com.devdressa.studycards"
},
"androidStatusBar": {
"backgroundColor": "#1a1a1a",
Expand Down
Binary file modified assets/adaptive-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 0 additions & 21 deletions components/Secao/Secao.jsx

This file was deleted.

5 changes: 0 additions & 5 deletions components/Secao/Secao.styles.js

This file was deleted.

3 changes: 0 additions & 3 deletions components/Secao/index.js

This file was deleted.

33 changes: 0 additions & 33 deletions components/TelaCard/TelaCard.jsx

This file was deleted.

5 changes: 0 additions & 5 deletions components/TelaCard/TelaCard.styles.js

This file was deleted.

3 changes: 0 additions & 3 deletions components/TelaCard/index.js

This file was deleted.

59 changes: 0 additions & 59 deletions services/sqlite/Card.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,11 @@
/*
- id
- titulo
- resposta
- categoriaId
*/

import db from "./SQLiteDatabase";

/**
* INICIALIZAÇÃO DA TABELA
* - Executa sempre, mas só cria a tabela caso não exista (primeira execução)
*/
db.transaction((tx) => {
//<<<<<<<<<<<<<<<<<<<<<<<< USE ISSO APENAS DURANTE OS TESTES!!! >>>>>>>>>>>>>>>>>>>>>>>
//tx.executeSql("DROP TABLE cars;");
//<<<<<<<<<<<<<<<<<<<<<<<< USE ISSO APENAS DURANTE OS TESTES!!! >>>>>>>>>>>>>>>>>>>>>>>

tx.executeSql(
"CREATE TABLE IF NOT EXISTS cards (id INTEGER PRIMARY KEY AUTOINCREMENT, titulo TEXT, resposta TEXT, categoriaId INT);"
);
});

/**
* CRIAÇÃO DE UM NOVO REGISTRO
* - Recebe um objeto;
* - Retorna uma Promise:
* - O resultado da Promise é o ID do registro (criado por AUTOINCREMENT)
* - Pode retornar erro (reject) caso exista erro no SQL ou nos parâmetros.
*/
const createCard = (obj) => {
return new Promise((resolve, reject) => {
db.transaction((tx) => {
Expand All @@ -46,13 +24,6 @@ const createCard = (obj) => {
});
};

/**
* ATUALIZA UM REGISTRO JÁ EXISTENTE
* - Recebe o ID do registro e um OBJETO com valores atualizados;
* - Retorna uma Promise:
* - O resultado da Promise é a quantidade de registros atualizados;
* - Pode retornar erro (reject) caso o ID não exista ou então caso ocorra erro no SQL.
*/
const updateCard = (obj) => {
return new Promise((resolve, reject) => {
db.transaction((tx) => {
Expand All @@ -71,13 +42,6 @@ const updateCard = (obj) => {
});
};

/**
* BUSCA UM REGISTRO POR MEIO DO ID
* - Recebe o ID do registro;
* - Retorna uma Promise:
* - O resultado da Promise é o objeto (caso exista);
* - Pode retornar erro (reject) caso o ID não exista ou então caso ocorra erro no SQL.
*/
const findCard = (id) => {
return new Promise((resolve, reject) => {
db.transaction((tx) => {
Expand All @@ -96,14 +60,6 @@ const findCard = (id) => {
});
};

/**
* BUSCA UM REGISTRO POR MEIO DO TITULO (brand)
* - Recebe a marca do carro;
* - Retorna uma Promise:
* - O resultado da Promise é um array com os objetos encontrados;
* - Pode retornar erro (reject) caso o ID não exista ou então caso ocorra erro no SQL;
* - Pode retornar um array vazio caso nenhum objeto seja encontrado.
*/
const findCardByTitulo = (brand) => {
return new Promise((resolve, reject) => {
db.transaction((tx) => {
Expand All @@ -122,14 +78,6 @@ const findCardByTitulo = (brand) => {
});
};

/**
* BUSCA TODOS OS REGISTROS DE UMA DETERMINADA TABELA
* - Não recebe parâmetros;
* - Retorna uma Promise:
* - O resultado da Promise é uma lista (Array) de objetos;
* - Pode retornar erro (reject) caso o ID não exista ou então caso ocorra erro no SQL;
* - Pode retornar um array vazio caso não existam registros.
*/
const allCardsCategory = (categoriaId, search) => {
return new Promise((resolve, reject) => {
db.transaction((tx) => {
Expand Down Expand Up @@ -161,13 +109,6 @@ const allCardsCategory = (categoriaId, search) => {
});
};

/**
* REMOVE UM REGISTRO POR MEIO DO ID
* - Recebe o ID do registro;
* - Retorna uma Promise:
* - O resultado da Promise a quantidade de registros removidos (zero indica que nada foi removido);
* - Pode retornar erro (reject) caso o ID não exista ou então caso ocorra erro no SQL.
*/
const removeCard = (id) => {
return new Promise((resolve, reject) => {
db.transaction((tx) => {
Expand Down
Loading

0 comments on commit 6d2ff9e

Please sign in to comment.