cleaned up the marketplace css a little

This commit is contained in:
Philip Ellis
2023-07-21 14:35:47 -05:00
parent 399e771344
commit 79141ea609
10 changed files with 43 additions and 29 deletions

View File

@@ -2,6 +2,7 @@ import React from 'react';
import styles from './styles.module.css';
import AmbassadorCard from '../AmbassadorCard';
import BounceLoader from 'react-spinners/BounceLoader';
import {discourseBaseURL, developerWebsiteDomain} from '../../../util/util';
import {getAmbassadors, getAmbassadorDetails} from '../../../services/DiscourseService';
export default function AmbassadorCards({
@@ -85,15 +86,15 @@ async function getMemberList(member, details) {
location: details.location,
website: details.website_name,
link:
'https://developer.sailpoint.com/discuss/u/' +
discourseBaseURL() + 'u/' +
member.username +
'/summary',
};
}
function getavatarURL(avatar) {
if (avatar.includes("developer.sailpoint.com")) {
return "https://developer.sailpoint.com" + avatar.replace("{size}", "120")
if (avatar.includes(developerWebsiteDomain())) {
return "https://" + developerWebsiteDomain() + avatar.replace("{size}", "120")
} else {
return avatar.replace("{size}", "120")
}

View File

@@ -2,6 +2,7 @@ import React from 'react';
import styles from './styles.module.css';
import BlogCard from '../BlogCard';
import BounceLoader from 'react-spinners/BounceLoader';
import {discourseBaseURL, developerWebsiteDomain} from '../../../util/util';
import {getBlogPosts, getTopic} from '../../../services/DiscourseService';
export default function BlogCards({
@@ -82,7 +83,7 @@ async function getPostList(topic) {
tags: topic.tags,
image: fullTopic.image_url,
link:
'https://developer.sailpoint.com/discuss/t/' +
discourseBaseURL() + 't/' +
topic.slug +
'/' +
topic.id,
@@ -96,7 +97,11 @@ async function getPostList(topic) {
}
function getavatarURL(avatar) {
return "https://developer.sailpoint.com" + avatar.replace("{size}", "120")
if (avatar.includes(developerWebsiteDomain())) {
return "https://" + developerWebsiteDomain() + avatar.replace("{size}", "120")
} else {
return avatar.replace("{size}", "120")
}
}
function styleExcerpt(excerpt) {

View File

@@ -1,6 +1,7 @@
import React from 'react';
import styles from './styles.module.css';
import DiscussCard from '../DiscussCard';
import {discourseBaseURL, developerWebsiteDomain} from '../../../util/util';
import {getTopPosts} from '../../../services/DiscourseService';
export default function HomepageDiscuss() {
@@ -65,7 +66,7 @@ function getPostList(posts, index) {
return {
tags: posts.topic_list.topics[index].tags,
link:
'https://developer.sailpoint.com/discuss/t/' +
discourseBaseURL() + 't/' +
posts.topic_list.topics[index].slug +
'/' +
posts.topic_list.topics[index].id,

View File

@@ -51,10 +51,10 @@ export default function MarketplaceCard({
<div className={styles.cardCommentText}>{post.replies}</div>
</div>
<div className={styles.cardUser}>
{/* <div className={styles.cardUser}>
<img className={styles.cardFace} src={useBaseUrl(post.creatorImage)}></img>
<div className={styles.cardName}>{post.name}</div>
</div>
</div> */}
{badge}

View File

@@ -2,7 +2,7 @@
.card {
position: relative;
margin-top: 20px;
min-height: 460px;
min-height: 450px;
/* UI Properties */
background: var(--dev-card-background);
box-shadow: var(--dev-card-shadow);
@@ -98,7 +98,7 @@
.cardData {
position: absolute;
bottom: 50px;
bottom: 20px;
left: 20px;
display: flex;
align-items: center;

View File

@@ -8,6 +8,7 @@ import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';
import 'react-tabs/style/react-tabs.css';
import ReactMarkdown from 'react-markdown';
import BounceLoader from 'react-spinners/BounceLoader';
import {discourseBaseURL, developerWebsiteDomain} from '../../../util/util';
export default function MarketplaceCardDetail({ details, rawPost }) {
const getDivText = (data, id) => {
const requirementPosition = data.indexOf('id="' + id + '"');
@@ -19,7 +20,7 @@ export default function MarketplaceCardDetail({ details, rawPost }) {
);
const incorrectURLPattern = /upload:\/\/([^"]+)/g;
const correctURLPattern =
'https://developer.sailpoint.com/discuss/uploads/short-url/$1';
discourseBaseURL() + 'uploads/short-url/$1';
return validContent.replace(incorrectURLPattern, correctURLPattern);
} else {
return 'No requirements found for this marketplace item';
@@ -51,7 +52,7 @@ export default function MarketplaceCardDetail({ details, rawPost }) {
<img
className={styles.buttonImage}
src={useBaseUrl('/icons/discourse.svg')}></img>
See More
Go to Download
</div>
</button>
<TabList>

View File

@@ -50,7 +50,7 @@
margin: 10px;
padding: 10px;
text-align: center;
width: 125px;
width: 155px;
background-color: #ffffff31;
position: absolute;
right: 0px;

View File

@@ -4,6 +4,7 @@ import MarketplaceCard from '../MarketplaceCard';
import Modal from 'react-modal';
import useBaseUrl from '@docusaurus/useBaseUrl';
import BounceLoader from 'react-spinners/BounceLoader';
import {discourseBaseURL, developerWebsiteDomain} from '../../../util/util';
import {
getMarketplacePosts,
@@ -121,7 +122,7 @@ async function getPostList(topic) {
tags: topic.tags,
image: fullTopic.image_url,
link:
'https://developer.sailpoint.com/discuss/t/' +
discourseBaseURL() + 'discuss/t/' +
topic.slug +
'/' +
topic.id,
@@ -135,8 +136,8 @@ async function getPostList(topic) {
}
function getavatarURL(avatar) {
if (avatar.includes("developer.sailpoint.com")) {
return "https://developer.sailpoint.com" + avatar.replace("{size}", "120")
if (avatar.includes(developerWebsiteDomain())) {
return "https://" + developerWebsiteDomain() + avatar.replace("{size}", "120")
} else {
return avatar.replace("{size}", "120")
}

View File

@@ -1,7 +1,9 @@
import {discourseBaseURL} from '../util/util';
export async function getTopPosts() {
try {
const response = await fetch(
'https://developer.sailpoint.com/discuss/top.json',
discourseBaseURL() + 'top.json',
);
return await response.json();
} catch (error) {
@@ -12,12 +14,12 @@ export async function getAmbassadors(expert) {
try {
if (expert) {
const response = await fetch(
'https://developer.sailpoint.com/discuss/groups/ambassador_expert/members.json',
discourseBaseURL() + 'groups/ambassador_expert/members.json',
);
return await response.json();
} else {
const response = await fetch(
'https://developer.sailpoint.com/discuss/groups/ambassador/members.json',
discourseBaseURL() + 'groups/ambassador/members.json',
);
return await response.json();
}
@@ -30,7 +32,7 @@ export async function getAmbassadors(expert) {
export async function getAmbassadorDetails(id) {
try {
const response = await fetch(
'https://developer.sailpoint.com/discuss/user-cards.json?user_ids=' + id.join(','),
discourseBaseURL() + 'user-cards.json?user_ids=' + id.join(','),
);
return await response.json();
} catch (error) {
@@ -54,9 +56,9 @@ export async function checkImage(url) {
export async function getBlogPosts(tags) {
let url = ''
if (tags) {
url = 'https://developer.sailpoint.com/discuss/search.json?q=category:blog-posts+tags:' + tags
url = discourseBaseURL() + 'search.json?q=category:blog-posts+tags:' + tags
} else {
url = 'https://developer.sailpoint.com/discuss/search.json?q=category:blog-posts'
url = discourseBaseURL() + 'search.json?q=category:blog-posts'
}
try {
const response = await fetch(
@@ -75,9 +77,9 @@ export async function getMarketplacePosts(tags, category) {
}
let url = ''
if (tags) {
url = 'https://developer.sailpoint.com/discuss/search.json?q=category:' + filterCategory + '+tags:' + tags
url = discourseBaseURL() + 'search.json?q=category:' + filterCategory + '+tags:' + tags
} else {
url = 'https://developer.sailpoint.com/discuss/search.json?q=category:' + filterCategory
url = discourseBaseURL() + 'search.json?q=category:' + filterCategory
}
try {
const response = await fetch(
@@ -92,7 +94,7 @@ export async function getMarketplacePosts(tags, category) {
export async function getTopic(id) {
try {
const response = await fetch(
'https://developer.sailpoint.com/discuss/t/' + id + '.json',
discourseBaseURL() + 't/' + id + '.json',
);
return await response.json();
} catch (error) {
@@ -103,7 +105,7 @@ export async function getTopic(id) {
export async function getMarketplaceTopic(id) {
try {
const response = await fetch(
'https://developer.sailpoint.com/discuss/t/' + id + '.json',
discourseBaseURL() + 't/' + id + '.json',
);
return await response.json();
} catch (error) {
@@ -114,7 +116,7 @@ export async function getMarketplaceTopic(id) {
export async function getMarketplaceTopicRaw(id) {
try {
const response = await fetch(
'https://developer.sailpoint.com/discuss/raw/' + id + '.json',
discourseBaseURL() + 'raw/' + id + '.json',
);
return await response.text();
} catch (error) {
@@ -125,7 +127,7 @@ export async function getMarketplaceTopicRaw(id) {
export async function getTags() {
try {
const response = await fetch(
'https://developer.sailpoint.com/discuss/tags.json',
discourseBaseURL() + 'tags.json',
);
return await response.json();
} catch (error) {
@@ -136,7 +138,7 @@ export async function getTags() {
export async function getCatagories() {
try {
const response = await fetch(
'https://developer.sailpoint.com/discuss/categories.json',
discourseBaseURL() + 'categories.json',
);
return await response.json();
} catch (error) {

View File

@@ -2,3 +2,6 @@ export function addDarkToFileName(filename) {
const parts = filename.split('.');
return parts[0] + '-dark.' + parts[1];
}
export function discourseBaseURL() {return 'https://developer.sailpoint.com/discuss/'}
export function developerWebsiteDomain() {return 'developer.sailpoint.com'}