Skip to content

Commit

Permalink
feat: change input type to password
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramin Rezaei committed May 28, 2024
1 parent 16e8df4 commit 67e45f3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/domains/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export function HomePage(){
value={code}
minLength={5}
maxLength={10}
type="password"
placeholder="Enter Your Magic Code"
onChange={(value) => setCode(value)}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function Input({
minLength?: number;
maxLength?: number;
placeholder?: string;
type?: 'text' | 'number';
type?: 'text' | 'number' | 'password';
onChange?: (value: string, name?: string) => void
}){
return (
Expand Down
2 changes: 1 addition & 1 deletion src/shared/firebase/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const AUTH = getAuth(FIREBASE_APP);
export const initFirebase = () => {
signInAnonymously(AUTH)
.then(() => {
console.log('%cDB - SUCCESS!', 'color: green');
console.log('%cSUCCESS: Firebase Connected!', 'color: green');
})
.catch(() => {
notify.error({ message: "Error: We couldn't connect to the Database!" });
Expand Down
7 changes: 5 additions & 2 deletions src/shared/firebase/requests/get-messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ export const GetMessagesRequest = (userId: GID, receiverId: GID, callback: GetMe
get(child(ref(DB), `${DATABASE_MESSAGES_TABLE_NAME}/`))
.then((snapshot) => {
if (snapshot.exists()) {
console.log('>>> Messages Updated');
const date = new Date();
const updateTime = `${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
console.log(`%c>>> Messages Updated! ${updateTime}`, 'color: #0284c7');

const messages = Object.entries(snapshot.val()).map(([key, value]) => ({
id: key,
...value || {}
})) as GMessage[];
const filteredMessages = messages.filter((item) => (item.receiverId === receiverId || item.userId === userId));
const filteredMessages = messages.filter((item) => item.userId === receiverId || item.userId === userId);

callback(filteredMessages);
}
Expand Down

0 comments on commit 67e45f3

Please sign in to comment.