diff --git a/.github/workflows/load.yml b/.github/workflows/load.yml new file mode 100644 index 0000000..d13e8ef --- /dev/null +++ b/.github/workflows/load.yml @@ -0,0 +1,36 @@ +name: bloggios-web-ui load + +on: + workflow_run: + workflows: ["bloggios-web-ui"] + types: + - completed + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '20' + + - name: Deploy using ssh + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.V4_HOST }} + username: ${{ secrets.V4_USERNAME }} + key: ${{ secrets.V4_VPS_PRIVATE_KEY }} + port: 22 + script: | + cd /root/bloggios-web-ui + git stash + git pull + npm cache clean --force + npm install + npm run build + pm2 restart app.config.js \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 28287d9..c981b27 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Bloggios Web UI devsandbox +name: bloggios-web-ui on: push: diff --git a/app/(root)/(pages)/[email]/page.tsx b/app/(root)/(pages)/[username]/page.tsx similarity index 76% rename from app/(root)/(pages)/[email]/page.tsx rename to app/(root)/(pages)/[username]/page.tsx index 375624c..a73581d 100644 --- a/app/(root)/(pages)/[email]/page.tsx +++ b/app/(root)/(pages)/[username]/page.tsx @@ -15,20 +15,17 @@ import UserProfileCard from "@/components/route_components/profile/UserProfileCa // return profileResponse.data; // }) -const getProfileAuth = cache(async (email: string) => { +const getProfileAuth = cache(async (username: string) => { try { - const profile = await getUserProfile(email); + const profile = await getUserProfile(username); return profile.data; } catch (error) { return notFound(); } }); -export async function generateMetadata({ params }: { params: { email: string } }) { - const finalMail = params.email.replace("%40", "@"); - if (!EMAIL_REGEX.test(finalMail)) { - notFound(); - } +export async function generateMetadata({ params }: { params: { username: string } }) { + const finalMail = params.username.replace("%40", "@"); const profileAuth = await getProfileAuth(finalMail); return { title: `${profileAuth.name} - Bloggios user Profile`, @@ -36,12 +33,9 @@ export async function generateMetadata({ params }: { params: { email: string } } } } -export default async function ProfilePage({ params }: { params: { email: string } }) { +export default async function ProfilePage({ params }: { params: { username: string } }) { - const finalMail = params.email.replace("%40", "@"); - if (!EMAIL_REGEX.test(finalMail)) { - notFound(); - } + const finalMail = params.username.replace("%40", "@"); const profileAuth = await getProfileAuth(finalMail); diff --git a/components/custom/blog/CommentCard.tsx b/components/custom/blog/CommentCard.tsx index d1eb5d9..cfa2b0b 100644 --- a/components/custom/blog/CommentCard.tsx +++ b/components/custom/blog/CommentCard.tsx @@ -17,6 +17,7 @@ const CommentCard = () => { profileImage={""} date={"2024-06-10T18:02:22.791+00:00"} email={"rohit@bloggios.com"} + username={"rohit"} /> diff --git a/components/custom/dropdowns/UserNavbarDropdown.tsx b/components/custom/dropdowns/UserNavbarDropdown.tsx index 4622257..dc78296 100644 --- a/components/custom/dropdowns/UserNavbarDropdown.tsx +++ b/components/custom/dropdowns/UserNavbarDropdown.tsx @@ -20,7 +20,7 @@ import {LOGIN_PAGE} from "@/constants/UiPathConstants"; export default function UserNavbarDropdown() { - const {isAuthenticated, email} = useSelector((state: RootState) => state.auth); + const {isAuthenticated, email, username} = useSelector((state: RootState) => state.auth); const {profileImage} = useSelector((state: RootState) => state.profile); const dispatch = useDispatch(); const router = useRouter(); @@ -80,13 +80,13 @@ export default function UserNavbarDropdown() { isReadOnly >
Logged in as
-{email}
+{username}
) : <>>}