Skip to content
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 components/Auth/Loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function AuthLoading() {
}}
onClick={() =>
router.push(
"/auth?next=" + encodeURIComponent(window.location.href)
"/auth?next=" + encodeURIComponent(window.location.href),
)
}
/>
Expand Down
6 changes: 3 additions & 3 deletions components/CheckIns/Reflect/Emoji.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,15 @@ export function Emoji({ mutationUrl, emoji, defaultData }) {
0: { name: defaultData?.reason },
1: defaultData?.stress,
2: (questions as any)[2].choices.find(
({ id }) => id == defaultData?.rest
({ id }) => id == defaultData?.rest,
),
3: defaultData?.pain,
4: (questions as any)[4].choices.find(
({ id }) => id == defaultData?.food
({ id }) => id == defaultData?.food,
),
}
: {},
[defaultData]
[defaultData],
);

const [answers, setAnswers] = useState({
Expand Down
8 changes: 4 additions & 4 deletions components/Coach/Goal/Activity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export function GoalActivity({ goal, children, open, setOpen }) {
.catch(() =>
toast.error(
"Yikes! Something went wrong while trying to fetch your activity",
toastStyles
)
toastStyles,
),
);
}
}, [open, session, goal, data]);
Expand Down Expand Up @@ -86,7 +86,7 @@ export function GoalActivity({ goal, children, open, setOpen }) {
const daysInMonth = new Date(
currentDate.year(),
month + 1,
0
0,
).getDate();
const isCurrentMonth = month === currentMonth;
const monthDays = [...new Array(daysInMonth)];
Expand Down Expand Up @@ -131,7 +131,7 @@ export function GoalActivity({ goal, children, open, setOpen }) {
.month(month)
.date(day + 1)
.format("MMMM D, YYYY"),
toastStyles
toastStyles,
)
}
sx={{
Expand Down
2 changes: 1 addition & 1 deletion components/Coach/Goal/Create/Custom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function CreateGoal() {
setLoading(false);
toast.error(
"An error occurred while trying to set your goal. Please try again.",
toastStyles
toastStyles,
);
}
};
Expand Down
2 changes: 1 addition & 1 deletion components/Coach/Goal/Create/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function ExploreGoalCard({ goal }) {
setLoading(false);
toast.error(
"An error occurred while trying to set your goal. Please try again.",
toastStyles
toastStyles,
);
}
};
Expand Down
19 changes: 0 additions & 19 deletions components/Coach/Goal/Create/goalTemplates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,127 +43,111 @@ export const goals = [
category: "Fitness",
description: "Drink 2 liters of water every day, for 30 days",
durationDays: 30,

},
{
name: "Go for a walk",
stepName: "Go for a walk",
category: "Fitness",
description: "Go for a walk every day, for 30 days",
durationDays: 30,

},
{
name: "Go to the gym",
stepName: "Go to the gym",
category: "Fitness",
description: "Go to the gym every day, for 30 days",
durationDays: 30,

},
{
name: "Write a blog post",
stepName: "Write a blog post",
category: "Career",
description: "Write a blog post every day, for 30 days",
durationDays: 30,

},
{
name: "Take a class",
stepName: "Take a class",
category: "Education",
description: "Take a class every day, for 30 days",
durationDays: 30,

},
{
name: "Write an email to a friend",
stepName: "Write an email to a friend",
category: "Relationships",
description: "Write an email to a friend every day, for 30 days",
durationDays: 30,

},
{
name: "Call a friend",
stepName: "Call a friend",
category: "Relationships",
description: "Call a friend every day, for 30 days",
durationDays: 30,

},
{
name: "Cook a new recipe",
stepName: "Cook a new recipe",
category: "Fitness",
description: "Cook a new recipe every day, for 7 days",
durationDays: 7,

},
{
name: "Learn a new language",
stepName: "Learn a new language",
category: "Education",
description: "Learn a new language every day, for 100 days",
durationDays: 100,

},
{
name: "Learn a new skill",
stepName: "Learn a new skill",
category: "Education",
description: "Learn a new skill every day, for 7 days",
durationDays: 7,

},
{
name: "Write a book",
stepName: "Work on my book",
category: "Education",
description: "Work on a book every day, for a year",
durationDays: 365,

},
{
name: "Write a poem",
stepName: "Write a poem",
category: "Education",
description: "Write a poem every day, for 100 days",
durationDays: 100,

},
{
name: "Learn to play an instrument",
stepName: "Learn to play an instrument",
category: "Hobbies",
description: "Learn to play an instrument every day, for 100 days",
durationDays: 100,

},
{
name: "Learn to dance",
stepName: "Learn to dance",
category: "Hobbies",
description: "Learn to dance every day, for 10 days",
durationDays: 10,

},
{
name: "Visit a place",
stepName: "Visit a place",
category: "Hobbies",
description: "Visit a place every day, for 7 days",
durationDays: 7,

},
{
name: "Limit your screen time to 1.5 hours",
stepName: "Limit your screen time to 1.5 hours",
category: "Mental health",
description: "Limit your screen time to 1.5 hours every day, for 30 days",
durationDays: 30,

},

{
Expand All @@ -172,7 +156,6 @@ export const goals = [
category: "Finance",
description: "Research and create a retirement plan within the next month",
durationDays: 30,

},

{
Expand All @@ -181,15 +164,13 @@ export const goals = [
category: "Finance",
description: "Pay off all credit card debt within 3 months",
durationDays: 90,

},
{
name: "Save $1000",
stepName: "Save $1000",
category: "Finance",
description: "Save $1000 in your savings account within 3 months",
durationDays: 90,

},
];

Expand Down
2 changes: 1 addition & 1 deletion components/Coach/Goal/Share.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function ShareGoal({ children, goal }) {
containScroll: "trimSnaps",
loop: false,
},
[WheelGesturesPlugin() as any]
[WheelGesturesPlugin() as any],
);

const [emblaCardRef, emblaCardApi] = useEmblaCarousel({ loop: false }, [
Expand Down
2 changes: 1 addition & 1 deletion components/Coach/Goal/ShareGoal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function ShareGoal({ children, goal }) {
containScroll: "trimSnaps",
loop: false,
},
[WheelGesturesPlugin() as any]
[WheelGesturesPlugin() as any],
);

const [emblaCardRef, emblaCardApi] = useEmblaCarousel({ loop: false }, [
Expand Down
6 changes: 3 additions & 3 deletions components/Coach/Goal/Task.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function GoalTask({ goal, setSlide, mutationUrl, open, setOpen }) {

const [showProgress, setShowProgress] = useState<boolean>(
dayjs(goal.lastCompleted).format("YYYY-MM-DD") ==
dayjs().format("YYYY-MM-DD") || false
dayjs().format("YYYY-MM-DD") || false,
);
const [showProgressLoader, setShowProgressLoader] = useState(false);
const [progressData, setProgressData] = useState<null | any>(null);
Expand Down Expand Up @@ -83,7 +83,7 @@ export function GoalTask({ goal, setSlide, mutationUrl, open, setOpen }) {
.catch(() => {
toast.error(
"Yikes! Something went wrong while trying to mark your routine as done",
toastStyles
toastStyles,
);
setDisabled(false);
});
Expand Down Expand Up @@ -322,7 +322,7 @@ export function GoalTask({ goal, setSlide, mutationUrl, open, setOpen }) {

const hasCompleted =
progressData.find(
(day) => dayjs(day.date).format("YYYY-MM-DD") === curr
(day) => dayjs(day.date).format("YYYY-MM-DD") === curr,
) ||
curr == dayjs(goal.lastCompleted).format("YYYY-MM-DD");

Expand Down
12 changes: 6 additions & 6 deletions components/Coach/MyGoals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export function MyGoals(): JSX.Element {
() =>
data
? data.filter(
(goal) => goal.progress >= goal.durationDays && !goal.completed
(goal) => goal.progress >= goal.durationDays && !goal.completed,
).length
: 0,
[data]
[data],
);

const deferredQuery = useDeferredValue(query);
Expand All @@ -43,7 +43,7 @@ export function MyGoals(): JSX.Element {
? 1
: s.progress === s.durationDays
? -1
: s.progress / s.durationDays - r.progress / r.durationDays
: s.progress / s.durationDays - r.progress / r.durationDays,
)
: []
).filter(
Expand All @@ -52,9 +52,9 @@ export function MyGoals(): JSX.Element {
`${e.timeOfDay}:00`
.toLowerCase()
.includes(deferredQuery.toLowerCase()) ||
e.stepName.toLowerCase().includes(deferredQuery.toLowerCase())
e.stepName.toLowerCase().includes(deferredQuery.toLowerCase()),
),
[data, deferredQuery]
[data, deferredQuery],
);
const palette = useColor(session.themeColor, useDarkMode(session.darkMode));

Expand Down Expand Up @@ -107,7 +107,7 @@ export function MyGoals(): JSX.Element {
{
// if goals are completed
data.filter(
(goal) => goal.progress >= goal.durationDays && !goal.completed
(goal) => goal.progress >= goal.durationDays && !goal.completed,
).length > 0 && (
<Typography
sx={{
Expand Down
2 changes: 1 addition & 1 deletion components/EmojiPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function EmojiPicker({

useEffect(
() => debouncedHandleSearch(inputValue),
[inputValue, debouncedHandleSearch]
[inputValue, debouncedHandleSearch],
);

async function handleSearch(value) {
Expand Down
2 changes: 1 addition & 1 deletion components/Group/Changelog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function Changelog({ disabled }) {
e.preventDefault();
setOpen(true);
},
[open]
[open],
);
const palette = useColor(session.themeColor, useDarkMode(session.darkMode));

Expand Down
4 changes: 2 additions & 2 deletions components/Group/Color.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ export function Color({
}) {
const session = useSession();
const invertColors = ["lime", "cyan", "green", "teal", "blue"].includes(
color
color,
);

const handleClick = () => {
updateSettings(session, "color", color, false, null, true).then(() =>
setTimeout(mutatePropertyData, 1000)
setTimeout(mutatePropertyData, 1000),
);
};

Expand Down
Loading