Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task #227193 - [FE] - Mobile responsive (addconnection page spacing,back button padding,chat window block unblock button allignment,loader on mobile domain list section) #704

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/nulp_elite/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,8 @@ function App() {
/>
))}
</Routes>
<LernModal />
</Router>
<LernModal />

</React.Suspense>
{/* </ChakraProvider> */}
{/* </ChakraProvider> */}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1336,8 +1336,8 @@ const AddConnections = () => {
) : (
<Button
type="button"
className="viewAll xs-mr-10"
onClick={handleBackClick}
className="custom-btn-primary mr-5"
>
{t("BACK")}
</Button>
Expand Down
2 changes: 1 addition & 1 deletion packages/nulp_elite/src/pages/content/CategoryPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ const CategoryPage = () => {
style={{ alignItems: "center",justifyContent:'space-between'}}
>
<p className="h3-title">{category === "Course" ? "Courses" : category}</p>
<Link onClick={handleGoBack} className="viewAll mr-17">
<Link onClick={handleGoBack} className="custom-btn-primary mr-17">
{t("BACK")}
</Link>
</Box>
Expand Down
2 changes: 1 addition & 1 deletion packages/nulp_elite/src/pages/content/joinCourse.js
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ const JoinCourse = () => {
> {t("LEAVE_COURSE")}

</Button>
}
)}
</Box>
</div>

Expand Down
27 changes: 5 additions & 22 deletions packages/nulp_elite/src/pages/search/DomainList.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,10 @@ const DomainList = ({ globalSearchQuery }) => {
const user = userID.find((user) => user.user_id === _userId);

if (!user) {
console.log("User ID not found. Calling fetchUserAccess...");
fetchUserAccess();
} else if (user.creator_access === true) {
navigate('/webapp/mylernsubmissions');
console.log("User ID found with creator access. No need to call fetchUserAccess.");
} else if (user.creator_access === false) {
console.log("User ID found but no creator access. Calling fetchUserAccess...");
fetchUserAccess();
}
} catch (error) {
Expand Down Expand Up @@ -185,7 +182,6 @@ const DomainList = ({ globalSearchQuery }) => {
fetchUserData();
getRecentlyAddedCourses();
getPopularCourses();
// console.log("domainWithImage--",domainWithImage)
}, []);

// Function to push data to the array
Expand All @@ -197,10 +193,6 @@ const DomainList = ({ globalSearchQuery }) => {
sessionStorage.setItem("previousRoutes", newPath);
try {
const uservData = await util.userData();
console.log(
"-------------",
uservData?.data?.result?.response?.framework?.id[0]
);
setOrgId(uservData?.data?.result?.response?.rootOrgId);
setFramework(uservData?.data?.result?.response?.framework?.id[0]);
} catch (error) {
Expand All @@ -223,10 +215,8 @@ const DomainList = ({ globalSearchQuery }) => {
try {
const url = `${urlConfig.URLS.PUBLIC_PREFIX}${urlConfig.URLS.CHANNEL.READ}/${orgId}`;
const response = await frameworkService.getChannel(url);
// console.log("channel---",response.data.result);
setChannelData(response.data.result);
} catch (error) {
console.log("error---", error);
showErrorMessage(t("FAILED_TO_FETCH_DATA"));
} finally {
setIsLoading(false);
Expand All @@ -241,7 +231,6 @@ const DomainList = ({ globalSearchQuery }) => {
const selectedIndex = categories.findIndex(
(category) => category.code === "board"
);
console.log("---------", selectedIndex);

response?.data?.result?.framework?.categories[selectedIndex].terms.map(
(term) => {
Expand All @@ -262,10 +251,8 @@ const DomainList = ({ globalSearchQuery }) => {
);
setData(itemsArray);
} catch (error) {
console.log("nulp-- error-", error);
showErrorMessage(t("FAILED_TO_FETCH_DATA"));
} finally {
console.log("nulp finally---");
setIsLoading(false);
}
};
Expand Down Expand Up @@ -341,7 +328,6 @@ const DomainList = ({ globalSearchQuery }) => {
}

const responseData = await response.json();
console.log("data", responseData);
setRecentlyAddedCourses(responseData?.result?.content || []);
} catch (error) {
showErrorMessage(t("FAILED_TO_FETCH_DATA"));
Expand All @@ -351,14 +337,12 @@ const DomainList = ({ globalSearchQuery }) => {
};

const loadContents = async (term) => {
// console.log(term);
navigate(`${routeConfig.ROUTES.CONTENTLIST_PAGE.CONTENTLIST}?1`, {
state: { domain: term.name, domainName: term.name },
});
};

const handleSearch = async (domainquery) => {
console.log(domainquery);
navigate(`${routeConfig.ROUTES.CONTENTLIST_PAGE.CONTENTLIST}?1`, {
state: { domainquery },
});
Expand All @@ -369,7 +353,6 @@ const DomainList = ({ globalSearchQuery }) => {
state: { domain: query, domainName: domainName },
});
};
// console.log(frameworkHardCodedData.result.framework.categories[0].terms);

const handleCardClick = (contentId, courseType) => {
if (courseType === "Course") {
Expand Down Expand Up @@ -450,7 +433,6 @@ const DomainList = ({ globalSearchQuery }) => {
}

const responseData = await response.json();
console.log("data", responseData);
setPopularCourses(responseData?.result?.content || []);
} catch (error) {
showErrorMessage(t("FAILED_TO_FETCH_DATA"));
Expand All @@ -467,15 +449,13 @@ const DomainList = ({ globalSearchQuery }) => {

const handleInputChange = (event) => {
setSearchQuery(event.target.value);
console.log("value", event.target.value);
};

const handleKeyPress = (event) => {
if (event.key === "Enter") {
onMobileSearch();
}
};
console.log(lernUser, 'lernUser from dashboard');


return (
Expand Down Expand Up @@ -528,7 +508,10 @@ const DomainList = ({ globalSearchQuery }) => {
spacing={2}
style={{ margin: "20px 0", marginBottom: "10px" }}
>
{data &&
{isLoading ? (
<Loading style={{ margin: "20px 50px", marginBottom: "10px" }}message={t("LOADING")} />
) :
(data &&
data.slice(0, 10).map((term) => (
<Grid
item
Expand Down Expand Up @@ -559,7 +542,7 @@ const DomainList = ({ globalSearchQuery }) => {
</h5>
</Box>
</Grid>
))}
)))}
</Grid>
</Box>
</Container>
Expand Down
7 changes: 5 additions & 2 deletions packages/nulp_elite/src/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,9 @@ button {
}

@media (max-width: 768px) {
.jss2{
display: block!important;
}
.xs-mt-10{
margin-top:10px;
}
Expand All @@ -792,7 +795,7 @@ button {
}
.viewAll{
font-size: 10px !important;
padding: 9px 4px !important;
padding: 10px !important;
}
.d-flex-none {
display: block !important;
Expand Down Expand Up @@ -1184,7 +1187,7 @@ button {
}

.MuiGrid-container.MuiGrid-spacing-xs-2 {
margin: 0 -16px !important;
margin: 40px -16px !important;
}

/* .react-multi-carousel-list{
Expand Down
Loading