Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
ReactNativeToDo2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Isaac Solomon
ReactNativeToDo2
Commits
6547c89f
"ProjektTest/other/GotsisWasilios/TDD_StringCalculator.py" did not exist on "77ce677850cccdac33e93d34bed6a5aadc9ad584"
Commit
6547c89f
authored
1 month ago
by
isaacwsolomon
Browse files
Options
Downloads
Patches
Plain Diff
Connected to firebase database
parent
ae214a12
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/screens/list.tsx
+16
-7
16 additions, 7 deletions
app/screens/list.tsx
firebaseConfig.ts
+1
-1
1 addition, 1 deletion
firebaseConfig.ts
with
17 additions
and
8 deletions
app/screens/list.tsx
+
16
−
7
View file @
6547c89f
import
React
from
'
react
'
;
import
{
addDoc
,
collection
}
from
'
firebase/firestore
'
;
import
React
,
{
useEffect
}
from
'
react
'
;
import
{
View
,
Text
,
Button
}
from
'
react-native
'
;
import
{
FIRESTORE_DB
}
from
'
../../firebaseConfig
'
;
const
List
=
({
navigation
}
:
any
)
=>
{
return
(
<
View
>
<
Text
>
List
</
Text
>
<
Button
onPress
=
{
()
=>
navigation
.
navigate
(
'
Details
'
)
}
title
=
"Open Details"
/>
</
View
>
);
useEffect
(()
=>
{},
[]);
const
addTodo
=
async
()
=>
{
console
.
log
(
'
ADD
'
);
const
doc
=
addDoc
(
collection
(
FIRESTORE_DB
,
'
todos
'
),
{
title
:
'
I am a test
'
,
done
:
false
});
console
.
log
(
'
📝 ~ file: List.tsx:12 ~ addTodo ~ doc:
'
,
doc
);
};
return
(
<
View
>
<
Button
onPress
=
{
()
=>
addTodo
()
}
title
=
"Add Todo"
/>
</
View
>
);
}
export
default
List
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
firebaseConfig.ts
+
1
−
1
View file @
6547c89f
...
...
@@ -22,4 +22,4 @@ const firebaseConfig = {
export
const
FIREBASE_APP
=
initializeApp
(
firebaseConfig
);
export
const
FIRESTORE_DB
=
getFirestore
(
FIREBASE_APP
);
export
const
FIREBASE_AUTH
=
getAuth
(
FIREBASE_APP
);
\ No newline at end of file
//export const FIREBASE_AUTH = getAuth(FIREBASE_APP);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment