From 1339ad634362348097ee0aab4c3a2e7b50668c7a Mon Sep 17 00:00:00 2001 From: Sujal Date: Fri, 9 Feb 2024 15:16:03 +0530 Subject: [PATCH 1/3] [Fixes done]#[1151][Feat : Truncating the title's and summary's when the Cards are side by side] --- .env.sample | 20 +-- .github/workflows/firebase-hosting-merge.yml | 20 +++ .../firebase-hosting-pull-request.yml | 17 +++ database.rules.json | 3 +- firestore.rules | 13 +- functions/.eslintrc.js | 28 +++++ functions/.gitignore | 3 +- functions/index.js | 59 +++------ functions/package.json | 15 ++- functions/private/cl-dev-pk.json | 14 +++ public/index.html | 114 +++++++++++++----- src/components/Card/CardWithoutPicture.jsx | 24 +++- src/components/HomePage/index.jsx | 3 +- .../BaseTutorialsComponent/TutorialCard.jsx | 18 +-- y | 4 + 15 files changed, 244 insertions(+), 111 deletions(-) create mode 100644 .github/workflows/firebase-hosting-merge.yml create mode 100644 .github/workflows/firebase-hosting-pull-request.yml create mode 100644 functions/.eslintrc.js create mode 100644 functions/private/cl-dev-pk.json create mode 100644 y diff --git a/.env.sample b/.env.sample index 79fa4b1a..b9a319ef 100644 --- a/.env.sample +++ b/.env.sample @@ -1,11 +1,11 @@ - VITE_APP_FIREBASE_API_KEY= - VITE_APP_AUTH_DOMAIN= - VITE_APP_FIREBASE_PROJECT_ID= - VITE_APP_FIREBASE_MESSAGING_SENDER_ID= - VITE_APP_FIREBASE_APP_ID= - VITE_APP_FIREBASE_MEASUREMENTID= - VITE_APP_DATABASE_URL= - VITE_APP_FIREBASE_FCM_VAPID_KEY= - VITE_APP_USE_EMULATOR= - CYPRESS_PROJECT_ID= + VITE_APP_FIREBASE_API_KEY="AIzaSyA3I8aPbJ9GRCD9dS1FoGAFHGXlwEYgOOY" + VITE_APP_AUTH_DOMAIN="codelabz-gsoc24.firebaseapp.com" + VITE_APP_FIREBASE_PROJECT_ID="codelabz-gsoc24" + VITE_APP_FIREBASE_MESSAGING_SENDER_ID="343629691607" + VITE_APP_FIREBASE_APP_ID="1:343629691607:web:fc8a4fd50eb3e043080e92" + VITE_APP_FIREBASE_MEASUREMENTID="G-BCZV7161Z9" + VITE_APP_DATABASE_URL="https://DATABASE_NAME.REGION.firebasedatabase.app" + VITE_APP_FIREBASE_FCM_VAPID_KEY="sV8Du6UY3_PbluQ7BFoOoIOdKVt84t5jhhJ3odSXKIk" + VITE_APP_USE_EMULATOR="true" + CYPRESS_PROJECT_ID="vtf66u" diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml new file mode 100644 index 00000000..a85fbf93 --- /dev/null +++ b/.github/workflows/firebase-hosting-merge.yml @@ -0,0 +1,20 @@ +# This file was auto-generated by the Firebase CLI +# https://github.com/firebase/firebase-tools + +name: Deploy to Firebase Hosting on merge +'on': + push: + branches: + - master +jobs: + build_and_deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: npm run build + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: '${{ secrets.GITHUB_TOKEN }}' + firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CODELABZ_GSOC24 }}' + channelId: live + projectId: codelabz-gsoc24 diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml new file mode 100644 index 00000000..9ed5952f --- /dev/null +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -0,0 +1,17 @@ +# This file was auto-generated by the Firebase CLI +# https://github.com/firebase/firebase-tools + +name: Deploy to Firebase Hosting on PR +'on': pull_request +jobs: + build_and_preview: + if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: npm run build + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: '${{ secrets.GITHUB_TOKEN }}' + firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CODELABZ_GSOC24 }}' + projectId: codelabz-gsoc24 diff --git a/database.rules.json b/database.rules.json index f1366029..f54493db 100644 --- a/database.rules.json +++ b/database.rules.json @@ -1,6 +1,7 @@ { + /* Visit https://firebase.google.com/docs/database/security to learn more about security rules. */ "rules": { ".read": false, ".write": false } -} +} \ No newline at end of file diff --git a/firestore.rules b/firestore.rules index 8d700cd7..5f1ef816 100644 --- a/firestore.rules +++ b/firestore.rules @@ -1,8 +1,19 @@ rules_version = '2'; + service cloud.firestore { match /databases/{database}/documents { + + // This rule allows anyone with your Firestore database reference to view, edit, + // and delete all data in your Firestore database. It is useful for getting + // started, but it is configured to expire after 30 days because it + // leaves your app open to attackers. At that time, all client + // requests to your Firestore database will be denied. + // + // Make sure to write security rules for your app before that time, or else + // all client requests to your Firestore database will be denied until you Update + // your rules match /{document=**} { - allow read, write: if true; + allow read, write: if request.time < timestamp.date(2024, 3, 4); } } } \ No newline at end of file diff --git a/functions/.eslintrc.js b/functions/.eslintrc.js new file mode 100644 index 00000000..f4cb76ca --- /dev/null +++ b/functions/.eslintrc.js @@ -0,0 +1,28 @@ +module.exports = { + env: { + es6: true, + node: true, + }, + parserOptions: { + "ecmaVersion": 2018, + }, + extends: [ + "eslint:recommended", + "google", + ], + rules: { + "no-restricted-globals": ["error", "name", "length"], + "prefer-arrow-callback": "error", + "quotes": ["error", "double", {"allowTemplateLiterals": true}], + }, + overrides: [ + { + files: ["**/*.spec.*"], + env: { + mocha: true, + }, + rules: {}, + }, + ], + globals: {}, +}; diff --git a/functions/.gitignore b/functions/.gitignore index 70197f08..40b878db 100644 --- a/functions/.gitignore +++ b/functions/.gitignore @@ -1,2 +1 @@ -node_modules/ -private/ +node_modules/ \ No newline at end of file diff --git a/functions/index.js b/functions/index.js index 8e98586a..e81477f6 100644 --- a/functions/index.js +++ b/functions/index.js @@ -1,50 +1,19 @@ -const functions = require("firebase-functions"); -const dotenv = require("dotenv"); -dotenv.config({ - path: "../.env" -}); - /** - * +++++++++++++++++++CLOUD FUNCTIONS+++++++++++++++++++++++++++++ - */ - -/**Import functions + * Import function triggers from their respective submodules: + * + * const {onCall} = require("firebase-functions/v2/https"); + * const {onDocumentWritten} = require("firebase-functions/v2/firestore"); + * + * See a full list of supported triggers at https://firebase.google.com/docs/functions */ -const onCallFunctions = require("./cloud_functions/onCallFunctions"); -const onCreateFunctions = require("./cloud_functions/onCreateFunctions"); -const onWriteFunctions = require("./cloud_functions/onWriteFunctions"); -const onUpdateFunctions = require("./cloud_functions/onUpdateFunctions"); -const pubSubFunctions = require("./cloud_functions/pubSubFunctions"); - -//+++++++++++++++++++++onCall Functions+++++++++++++++++++++++++++++++++ -exports.resendVerificationEmail = functions.https.onCall( - onCallFunctions.resendVerificationEmailHandler -); - -exports.sendPasswordUpdateEmail = functions.https.onCall( - onCallFunctions.sendPasswordUpdateEmailHandler -); - -//+++++++++++++++++++++onCreate Functions+++++++++++++++++++++++++++++++ -exports.sendVerificationEmail = functions.auth - .user() - .onCreate(onCreateFunctions.sendVerificationEmailHandler); - -exports.createOrganization = functions.firestore - .document("cl_org_general/{org_handle}") - .onCreate(onCreateFunctions.createOrganizationHandler); -//++++++++++++++++++++onWrite Functions+++++++++++++++++++++++++++++++ -exports.registerUserHandle = functions.firestore - .document("cl_user/{uid}") - .onWrite(onWriteFunctions.registerUserHandleHandler); +const {onRequest} = require("firebase-functions/v2/https"); +const logger = require("firebase-functions/logger"); -//++++++++++++++++++++onUpdate Functions++++++++++++++++++++++++++++++ -exports.updateOrgUser = functions.firestore - .document("cl_org_general/{org_handle}/cl_org_users/users") - .onUpdate(onUpdateFunctions.addOrgUserHandler); +// Create and deploy your first functions +// https://firebase.google.com/docs/functions/get-started -//++++++++++++++++++++Pub/Sub Functions++++++++++++++++++++++++++++++ -exports.deleteTutorialSteps = functions.pubsub - .schedule("every 7 days") - .onRun(pubSubFunctions.deleteTutorialStepsHandler); +// exports.helloWorld = onRequest((request, response) => { +// logger.info("Hello logs!", {structuredData: true}); +// response.send("Hello from Firebase!"); +// }); diff --git a/functions/package.json b/functions/package.json index f20d6f03..a88bc5e2 100644 --- a/functions/package.json +++ b/functions/package.json @@ -10,18 +10,17 @@ "logs": "firebase functions:log" }, "engines": { - "node": "10" + "node": "18" }, + "main": "index.js", "dependencies": { - "dotenv": "^16.0.1", - "firebase-admin": "^9.0.0", - "firebase-functions": "^3.9.0", - "lodash": "^4.17.19" + "firebase-admin": "^11.8.0", + "firebase-functions": "^4.3.1" }, "devDependencies": { - "eslint": "^5.12.0", - "eslint-plugin-promise": "^4.0.1", - "firebase-functions-test": "^0.2.0" + "eslint": "^8.15.0", + "eslint-config-google": "^0.14.0", + "firebase-functions-test": "^3.1.0" }, "private": true } diff --git a/functions/private/cl-dev-pk.json b/functions/private/cl-dev-pk.json new file mode 100644 index 00000000..5642cac0 --- /dev/null +++ b/functions/private/cl-dev-pk.json @@ -0,0 +1,14 @@ +{ + "type": "service_account", + "project_id": "codelabz-gsoc24", + "private_key_id": "f6aec9fe78ebf53b5f6086cdbd09e245f6c0cd22", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCexj7GEzOAbBBJ\nSamCs16P0+CZuzoOir3O1a4GCE2/dGwf7E6YNKzvSqJYexS0FNJwjol16vVx0jUt\n+NJS9kpkTPf3ds4p++5DAy46rom61ktMYz/YZvWTnkke+0+oR50+L8VZrtn8rW2m\n5vhX8uZcx/Mj1+sVC4xMQPPrUwFDTHEkahKkYsnhSmStwHsOGG/KaeKttnTUN0OX\nJSwCtIfHWiKc2eWskgoYeI6V4JHhgp7/G3DJjZAtTMbS8dyXlYuTGMb8upkYSZu5\n8i7sSQcOKmUXU3/ddnlwYX7nmg1NhOmBg0pUSrS4jmagqGjis9N2TrBjzDX1U2I1\ntWQBhICHAgMBAAECggEAAoVJarq3wNG9fOVCfB2aN5uqZn9J/gA4izQUzBSb49I6\nPFPzopYTf+HtOeJhdN/FFbqYPdsBEoppkiqab8JL5AykxO3fQc4K/WuWLEzEno3X\nf76DoPfhe4ix/5jOrgzN5WERN61/Z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hFZdqeHLQ9/GSneC8Q\neAxgoA/wdxA/piq5GTpiFKg=\n-----END PRIVATE KEY-----\n", + "client_email": "firebase-adminsdk-45w7y@codelabz-gsoc24.iam.gserviceaccount.com", + "client_id": "112002644236744622520", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-45w7y%40codelabz-gsoc24.iam.gserviceaccount.com", + "universe_domain": "googleapis.com" + } + \ No newline at end of file diff --git a/public/index.html b/public/index.html index 75393131..db385020 100644 --- a/public/index.html +++ b/public/index.html @@ -1,41 +1,89 @@ - + - - - - - + + + Welcome to Firebase Hosting - - + + + + + + + + + + + + - - - CodeLabz + + + - -
- +
+

Welcome

+

Firebase Hosting Setup Complete

+

You're seeing this because you've successfully setup Firebase Hosting. Now it's time to go build something extraordinary!

+ Open Hosting Documentation +
+

Firebase SDK Loading…

+ + diff --git a/src/components/Card/CardWithoutPicture.jsx b/src/components/Card/CardWithoutPicture.jsx index abc4ecb0..5effbf06 100644 --- a/src/components/Card/CardWithoutPicture.jsx +++ b/src/components/Card/CardWithoutPicture.jsx @@ -72,6 +72,8 @@ export default function CardWithoutPicture({ tutorial }) { const dispatch = useDispatch(); const firebase = useFirebase(); const firestore = useFirestore(); + const [toggleTitle, setToggleTitle] = useState(false); + const [toggleSummary, setToggleSummary] = useState(false); const handleIncrement = () => { setCount(count + 1); }; @@ -147,7 +149,16 @@ export default function CardWithoutPicture({ tutorial }) { data-testId="codelabzDetails" > - {tutorial?.title} + {tutorial?.title.length > 200 ? toggleTitle ? tutorial?.title : tutorial?.title.slice(0, 200) : tutorial?.title} + {tutorial?.title.length > 200 ? toggleTitle ? "" : (<> + .... + + ) : ""} + - {tutorial?.summary} + {tutorial?.summary.length > 600 ? toggleSummary ? tutorial?.summary : tutorial?.summary.slice(0, 600) : tutorial?.summary} + {tutorial?.summary.length > 600 ? toggleSummary ? "" : (<> + .... + + ) : ""} + {/* {tutorial?.summary} */} diff --git a/src/components/HomePage/index.jsx b/src/components/HomePage/index.jsx index e8190e6b..4eed314c 100644 --- a/src/components/HomePage/index.jsx +++ b/src/components/HomePage/index.jsx @@ -184,7 +184,7 @@ function HomePage({ background = "white", textColor = "black" }) { }) => homepageFeedArray ); - const notification = () => {}; + const notification = () => { }; const handleChange = (event, newValue) => { setValue(newValue); }; @@ -302,6 +302,7 @@ function HomePage({ background = "white", textColor = "black" }) { + - - - {title} + + + {title.length > 25 ? title.slice(0, 25) : title} + {title.length > 25 ? "..." : ""} - {title} + {title.length > 180 ? title.slice(0, 180) : title} + {title.length > 180 ? "..." : ""} {loading ? : null} {loading ? : null} @@ -44,16 +46,16 @@ const TutorialCard = ({ p={1} m={1} bgcolor="background.paper" - sx={{ height: 100 }} + sx={{ height: 70, ml: 3 }} > - - + + diff --git a/y b/y new file mode 100644 index 00000000..415027e5 --- /dev/null +++ b/y @@ -0,0 +1,4 @@ +{ + "indexes": [], + "fieldOverrides": [] +} From 9d0f112e51e8e0a69f19ab621cc9aa78913d2145 Mon Sep 17 00:00:00 2001 From: Sujal Date: Fri, 9 Feb 2024 15:26:41 +0530 Subject: [PATCH 2/3] first pull --- .github/workflows/firebase-hosting-merge.yml | 6 +- .../firebase-hosting-pull-request.yml | 8 +- .gitignore | 1 + database.rules.json | 2 +- functions/.eslintrc.js | 19 +- functions/index.js | 2 +- functions/private/cl-dev-pk.json | 25 +- src/components/Card/CardWithoutPicture.jsx | 81 +++-- src/components/HomePage/index.jsx | 3 +- .../BaseTutorialsComponent/TutorialCard.jsx | 8 +- src/store/actions/tutorialsActions.js | 294 +++++++++--------- 11 files changed, 245 insertions(+), 204 deletions(-) diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml index a85fbf93..027fa95c 100644 --- a/.github/workflows/firebase-hosting-merge.yml +++ b/.github/workflows/firebase-hosting-merge.yml @@ -2,7 +2,7 @@ # https://github.com/firebase/firebase-tools name: Deploy to Firebase Hosting on merge -'on': +"on": push: branches: - master @@ -14,7 +14,7 @@ jobs: - run: npm run build - uses: FirebaseExtended/action-hosting-deploy@v0 with: - repoToken: '${{ secrets.GITHUB_TOKEN }}' - firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CODELABZ_GSOC24 }}' + repoToken: "${{ secrets.GITHUB_TOKEN }}" + firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_CODELABZ_GSOC24 }}" channelId: live projectId: codelabz-gsoc24 diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml index 9ed5952f..4d9726e0 100644 --- a/.github/workflows/firebase-hosting-pull-request.yml +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -2,16 +2,16 @@ # https://github.com/firebase/firebase-tools name: Deploy to Firebase Hosting on PR -'on': pull_request +"on": pull_request jobs: build_and_preview: - if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}' + if: "${{ github.event.pull_request.head.repo.full_name == github.repository }}" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: npm run build - uses: FirebaseExtended/action-hosting-deploy@v0 with: - repoToken: '${{ secrets.GITHUB_TOKEN }}' - firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CODELABZ_GSOC24 }}' + repoToken: "${{ secrets.GITHUB_TOKEN }}" + firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_CODELABZ_GSOC24 }}" projectId: codelabz-gsoc24 diff --git a/.gitignore b/.gitignore index 4b284840..1df4d686 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ .env.development.local .env.test.local .env.production.local +.env.sample npm-debug.log* yarn-debug.log* diff --git a/database.rules.json b/database.rules.json index f54493db..4335e236 100644 --- a/database.rules.json +++ b/database.rules.json @@ -4,4 +4,4 @@ ".read": false, ".write": false } -} \ No newline at end of file +} diff --git a/functions/.eslintrc.js b/functions/.eslintrc.js index f4cb76ca..65f0d8b1 100644 --- a/functions/.eslintrc.js +++ b/functions/.eslintrc.js @@ -1,28 +1,25 @@ module.exports = { env: { es6: true, - node: true, + node: true }, parserOptions: { - "ecmaVersion": 2018, + ecmaVersion: 2018 }, - extends: [ - "eslint:recommended", - "google", - ], + extends: ["eslint:recommended", "google"], rules: { "no-restricted-globals": ["error", "name", "length"], "prefer-arrow-callback": "error", - "quotes": ["error", "double", {"allowTemplateLiterals": true}], + quotes: ["error", "double", { allowTemplateLiterals: true }] }, overrides: [ { files: ["**/*.spec.*"], env: { - mocha: true, + mocha: true }, - rules: {}, - }, + rules: {} + } ], - globals: {}, + globals: {} }; diff --git a/functions/index.js b/functions/index.js index e81477f6..6fa37be1 100644 --- a/functions/index.js +++ b/functions/index.js @@ -7,7 +7,7 @@ * See a full list of supported triggers at https://firebase.google.com/docs/functions */ -const {onRequest} = require("firebase-functions/v2/https"); +const { onRequest } = require("firebase-functions/v2/https"); const logger = require("firebase-functions/logger"); // Create and deploy your first functions diff --git a/functions/private/cl-dev-pk.json b/functions/private/cl-dev-pk.json index 5642cac0..f4009e09 100644 --- a/functions/private/cl-dev-pk.json +++ b/functions/private/cl-dev-pk.json @@ -1,14 +1,13 @@ { - "type": "service_account", - "project_id": "codelabz-gsoc24", - "private_key_id": "f6aec9fe78ebf53b5f6086cdbd09e245f6c0cd22", - "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCexj7GEzOAbBBJ\nSamCs16P0+CZuzoOir3O1a4GCE2/dGwf7E6YNKzvSqJYexS0FNJwjol16vVx0jUt\n+NJS9kpkTPf3ds4p++5DAy46rom61ktMYz/YZvWTnkke+0+oR50+L8VZrtn8rW2m\n5vhX8uZcx/Mj1+sVC4xMQPPrUwFDTHEkahKkYsnhSmStwHsOGG/KaeKttnTUN0OX\nJ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GjNE0/UitPeA0FIPC6Wla4kIfwKQcLa4inKkj4T+0blh6\nKQLFIFfbEjm56UABpi9Pouq+1shUptYg+SD6P4RbVZGXmgYRE9YMNac24rCd6zYy\nTPVLmiSZwMW1nt4YX2m5JSqO2CB2C1ef2VcATT99AoGAT/nNCZN8C+gu1gJ6mkmq\nJDgNdLV907vKenZlOez5EB6Uns20v1YyOuK7EyMUnf9NHr/5ZyPw+yT7RCJ28YO3\nclXF4gkKuVwcxm/ccsZhmqBb2EzrF1rnbcgtEocRG3zYmPhFZdqeHLQ9/GSneC8Q\neAxgoA/wdxA/piq5GTpiFKg=\n-----END PRIVATE KEY-----\n", - "client_email": "firebase-adminsdk-45w7y@codelabz-gsoc24.iam.gserviceaccount.com", - "client_id": "112002644236744622520", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://oauth2.googleapis.com/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-45w7y%40codelabz-gsoc24.iam.gserviceaccount.com", - "universe_domain": "googleapis.com" - } - \ No newline at end of file + "type": "service_account", + "project_id": "codelabz-gsoc24", + "private_key_id": "f6aec9fe78ebf53b5f6086cdbd09e245f6c0cd22", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCexj7GEzOAbBBJ\nSamCs16P0+CZuzoOir3O1a4GCE2/dGwf7E6YNKzvSqJYexS0FNJwjol16vVx0jUt\n+NJS9kpkTPf3ds4p++5DAy46rom61ktMYz/YZvWTnkke+0+oR50+L8VZrtn8rW2m\n5vhX8uZcx/Mj1+sVC4xMQPPrUwFDTHEkahKkYsnhSmStwHsOGG/KaeKttnTUN0OX\nJSwCtIfHWiKc2eWskgoYeI6V4JHhgp7/G3DJjZAtTMbS8dyXlYuTGMb8upkYSZu5\n8i7sSQcOKmUXU3/ddnlwYX7n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RE9YMNac24rCd6zYy\nTPVLmiSZwMW1nt4YX2m5JSqO2CB2C1ef2VcATT99AoGAT/nNCZN8C+gu1gJ6mkmq\nJDgNdLV907vKenZlOez5EB6Uns20v1YyOuK7EyMUnf9NHr/5ZyPw+yT7RCJ28YO3\nclXF4gkKuVwcxm/ccsZhmqBb2EzrF1rnbcgtEocRG3zYmPhFZdqeHLQ9/GSneC8Q\neAxgoA/wdxA/piq5GTpiFKg=\n-----END PRIVATE KEY-----\n", + "client_email": "firebase-adminsdk-45w7y@codelabz-gsoc24.iam.gserviceaccount.com", + "client_id": "112002644236744622520", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-45w7y%40codelabz-gsoc24.iam.gserviceaccount.com", + "universe_domain": "googleapis.com" +} diff --git a/src/components/Card/CardWithoutPicture.jsx b/src/components/Card/CardWithoutPicture.jsx index 5effbf06..4de144c0 100644 --- a/src/components/Card/CardWithoutPicture.jsx +++ b/src/components/Card/CardWithoutPicture.jsx @@ -149,16 +149,37 @@ export default function CardWithoutPicture({ tutorial }) { data-testId="codelabzDetails" > - {tutorial?.title.length > 200 ? toggleTitle ? tutorial?.title : tutorial?.title.slice(0, 200) : tutorial?.title} - {tutorial?.title.length > 200 ? toggleTitle ? "" : (<> - .... - - ) : ""} - + {tutorial?.title.length > 200 + ? toggleTitle + ? tutorial?.title + : tutorial?.title.slice(0, 200) + : tutorial?.title} + {tutorial?.title.length > 200 ? ( + toggleTitle ? ( + "" + ) : ( + <> + .... + + + ) + ) : ( + "" + )} - {tutorial?.summary.length > 600 ? toggleSummary ? tutorial?.summary : tutorial?.summary.slice(0, 600) : tutorial?.summary} - {tutorial?.summary.length > 600 ? toggleSummary ? "" : (<> - .... - - ) : ""} + {tutorial?.summary.length > 600 + ? toggleSummary + ? tutorial?.summary + : tutorial?.summary.slice(0, 600) + : tutorial?.summary} + {tutorial?.summary.length > 600 ? ( + toggleSummary ? ( + "" + ) : ( + <> + .... + + + ) + ) : ( + "" + )} {/* {tutorial?.summary} */} diff --git a/src/components/HomePage/index.jsx b/src/components/HomePage/index.jsx index 4eed314c..e8190e6b 100644 --- a/src/components/HomePage/index.jsx +++ b/src/components/HomePage/index.jsx @@ -184,7 +184,7 @@ function HomePage({ background = "white", textColor = "black" }) { }) => homepageFeedArray ); - const notification = () => { }; + const notification = () => {}; const handleChange = (event, newValue) => { setValue(newValue); }; @@ -302,7 +302,6 @@ function HomePage({ background = "white", textColor = "black" }) { - - - + + {title.length > 25 ? title.slice(0, 25) : title} {title.length > 25 ? "..." : ""} @@ -48,7 +50,7 @@ const TutorialCard = ({ bgcolor="background.paper" sx={{ height: 70, ml: 3 }} > - +