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

Fixes #152 #171

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion client/src/components/Contributors/Contributor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Avatar, Stack, Typography, Link, Paper } from '@mui/material';
import { contributors } from './contributors';

interface IProps {
contributor: typeof contributors[number];
contributor: (typeof contributors)[number];
topContributor?: boolean;
}

Expand Down
2 changes: 1 addition & 1 deletion client/src/data/countryCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ export const countries = [
{ code: 'ZW', label: 'Zimbabwe', phone: '263' },
];

export type CountryType = typeof countries[0];
export type CountryType = (typeof countries)[0];

export const countryCodetoName: Record<string, string> = {
BD: 'Bangladesh',
Expand Down
242 changes: 19 additions & 223 deletions client/src/data/topics.ts
Original file line number Diff line number Diff line change
@@ -1,231 +1,28 @@
import axios from 'axios';
import { SERVER_URL } from 'config.keys';
import { Topic } from 'types';
import { shuffleArray } from 'utils/helper';

type MotivationType = 'Job Search' | 'Career Advice' | 'Skills' | 'Leadership';

const topicsData: Topic[] = [
{
value: 0,
topicName: 'Practice Case Study',
motivation: 'Job Search',
description:
'Have an in-depth, detailed examination of a particular case within a real-world context.',
emojiIcon: '🔍',
emojiBadge: '🧑‍⚖️',
},
{
value: 1,
topicName: 'Practice Mock Interview',
motivation: 'Job Search',
description:
'Practice HR, technical and behavioral interviews with mentors.',
emojiIcon: '🔍',
emojiBadge: '🧑🏻‍🏫',
},
{
value: 2,
topicName: 'Resume and Portfolio Review',
motivation: 'Job Search',
description: 'Get actionable feedback on your resume or portfolio.',
emojiIcon: '🔍',
emojiBadge: '💬',
},
// const topicsData: Topic[] = [];

{
value: 3,
topicName: 'Acing technical interviews',
motivation: 'Job Search',
description:
'Learn the best ways to answer technical interview questions with framework',
emojiIcon: '🔍',
emojiBadge: '💁🏻',
},
{
value: 4,
topicName: 'Breaking into tech',
motivation: 'Job Search',
description:
"Talk to people who've broken into the tech industry and learn their stories.",
emojiIcon: '🔍',
emojiBadge: '👋',
},
const getTopics = () => {
const fetchTopics = async () => {
let topics: Topic[] = [];
try {
const resp = await axios.get<Topic[]>(`${SERVER_URL}/api/get-topics`);
topics = resp.data;
return topics;
} catch (err) {
console.error(err);
}

{
value: 5,
topicName: 'Changing Roles',
motivation: 'Career Advice',
description: 'Tips for transitioning into a new role or company',
emojiIcon: '⚡',
emojiBadge: '🌠',
},
{
value: 6,
topicName: 'Getting the most out of my internship',
motivation: 'Career Advice',
description:
'Strategies to maximize the amount of learning during an internship or co-op programs',
emojiIcon: '⚡',
emojiBadge: '📚',
},
{
value: 7,
topicName: 'How to get promoted',
motivation: 'Career Advice',
description:
'How to successfully prepare and position yourself for a job promotion?',
emojiIcon: '⚡',
emojiBadge: '📈',
},
{
value: 8,
topicName: 'Negotiating a Job Offer',
motivation: 'Career Advice',
description: 'How to ask for a promotion and negotiate for salary raise?',
emojiIcon: '⚡',
emojiBadge: '🤝',
},
{
value: 9,
topicName: 'Design Career Path',
motivation: 'Career Advice',
description:
'How to think about design career paths and what progression looks like for designers?',
emojiIcon: '⚡',
emojiBadge: '🤓',
},
{
value: 10,
topicName: 'Product Management Career Path',
motivation: 'Career Advice',
description: 'Learn the career path and progression for product managers.',
emojiIcon: '⚡',
emojiBadge: '🌱',
},
{
value: 11,
topicName: 'Dealing with Imposter Syndrome',
motivation: 'Mentorship',
description:
'Talk to people who have learned to manage their imposter syndrome.',
emojiIcon: '👏',
emojiBadge: '🤴',
},
{
value: 12,
topicName: 'Managing Burnout',
motivation: 'Mentorship',
description:
'Learn essential burnout prevention techniques and replenish physical and emotional energy.',
emojiIcon: '👏',
emojiBadge: '🧨',
},
{
value: 13,
topicName: 'Working Remotely',
motivation: 'Mentorship',
description:
'Making remote and globally distributed teams work for you and your needs.',
emojiIcon: '👏',
emojiBadge: '🌚',
},
{
value: 14,
topicName: 'Fostering a Good Team Culture',
motivation: 'Leadership',
description:
'How to create a positive workplace culture that drives collaboration and productivity?',
emojiIcon: '✊',
emojiBadge: '🥧',
},
{
value: 15,
topicName: 'Building An Effective Team',
motivation: 'Leadership',
description:
'Steps to building and maintaining a strong, cohesive and effective team.',
emojiIcon: '✊',
emojiBadge: '☕',
},
{
value: 16,
topicName: 'Keeping Team Member Motivated',
motivation: 'Leadership',
description:
'Understanding factors that lead to a motivated team - recognition, communication and more.',
emojiIcon: '✊',
emojiBadge: '🙌',
},
{
value: 17,
topicName: 'Managing a remote team',
motivation: 'Leadership',
description:
'Learn the tips to successfully manage a team in a remote environment.',
emojiIcon: '✊',
emojiBadge: '👨‍🏫',
},
{
value: 18,
topicName: 'Managing People',
motivation: 'Leadership',
description:
'Understand the process of training, motivating and directing your team members.',
emojiIcon: '✊',
emojiBadge: '👯',
},
{
value: 19,
topicName: 'Avoiding common dysfunctions',
motivation: 'Leadership',
description:
'How to maintain trust, commitment, accountability deliver results while handling conflict',
emojiIcon: '✊',
emojiBadge: '⚒️',
},
{
value: 20,
topicName: 'Present Your work with Impact',
motivation: 'Skills',
description:
'Learn how to properly present your work and share ideas and opinions.',
emojiIcon: '🚀',
emojiBadge: '🧙‍♂️',
},
{
value: 21,
topicName: 'Giving effective Feedback',
motivation: 'Skills',
description: 'Ways to provide constructive feedback to team members.',
emojiIcon: '🚀',
emojiBadge: '🙊',
},
{
value: 22,
topicName: 'Running Effective Meetings',
motivation: 'Skills',
description:
'Manage team expectations and get the most out of your meetings.',
emojiIcon: '🚀',
emojiBadge: '💨',
},
{
value: 23,
topicName: 'Improving Problem Solving',
motivation: 'Skills',
description: 'Learn the quintessential skill required for job interviews',
emojiIcon: '🚀',
emojiBadge: '👩‍💻',
},
return topics;
};

{
value: 24,
topicName: 'Getting started with Open Source',
motivation: 'Skills',
description: 'Start contributing to production grade software',
emojiIcon: '🚀',
emojiBadge: '🔮',
},
];
return fetchTopics();
};

export const getTopicOptions = (motivation: MotivationType) =>
topics
Expand All @@ -235,6 +32,5 @@ export const getTopicOptions = (motivation: MotivationType) =>
value: topic.value,
}));

export const topics = topicsData.sort((a, b) => a.value - b.value);

export const shuffleTopics = shuffleArray(topicsData);
export const shuffleTopics = shuffleArray(await getTopics());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use top-level awaits because it may not be supported in some old browsers and hence the checks on this PR are failing.
Try to come up with something that does not involve top-level awaits.

export const topics = shuffleTopics.sort((a, b) => a.value - b.value);