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

feature: Sticker Positioning #76

Merged
merged 8 commits into from
Oct 29, 2023
Merged

Conversation

alexanderl19
Copy link
Contributor

@alexanderl19 alexanderl19 commented Oct 16, 2023

Removes the sticker layer component, and adds a new component to position stickers relative to an element.

The component takes in any element as a child. It also takes in stickers in a prop like so:

<StickerPosition
	stickers={[
		{
			Node: HeartSticker,
			positionX: "right",
			positionY: "bottom",
			offsetX: 50,
			offsetY: 50,
		},
	]}
>
	<Button
		className={styles.applyButton}
		href="/apply"
		variant=""
		target="_blank"
		disabled
	>
		<span>Applications have closed!</span>
	</Button>
</StickerPosition>

The stickers are then positioned relative to one of the corners of the child element.

@alexanderl19 alexanderl19 changed the title update: removed deadzone feature/sticker-positioning Oct 16, 2023
@alexanderl19 alexanderl19 marked this pull request as ready for review October 16, 2023 07:21
@alexanderl19 alexanderl19 marked this pull request as draft October 16, 2023 07:21
@alexanderl19 alexanderl19 marked this pull request as ready for review October 22, 2023 09:31
@alexanderl19 alexanderl19 reopened this Oct 22, 2023
@github-actions
Copy link

github-actions bot commented Oct 22, 2023

Deploy preview for zothacks-site-2023 ready!

Name Hack at UCI Site
Preview Visit Preview
Commit 85c2212

@github-actions
Copy link

github-actions bot commented Oct 22, 2023

Deploy preview for zothacks-site-2023-sanity ready!

Name Sanity Studio
Preview Visit Preview
Commit 85c2212

Copy link
Contributor

@tyleryy tyleryy left a comment

Choose a reason for hiding this comment

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

I noticed the sticker position "jumps" as soon as you adjust the window. Sticker positioning changing while resizing has been an issue, so this could be resolved in another PR. Let me know what you think.

Screen.Recording.2023-10-22.at.3.09.59.AM.mov

apps/site/src/components/Sticker/BaseSticker.module.scss Outdated Show resolved Hide resolved
apps/site/src/components/Sticker/BaseSticker.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@tyleryy tyleryy left a comment

Choose a reason for hiding this comment

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

I noticed the Hack Sticker "jumps" when the window is resized, as shown in the previous video. I'm a bit hesitant to merge into Prod with this behavior.

@taesungh
Copy link
Member

Could you provide a title and include a description of changes in the PR?

@alexanderl19 alexanderl19 changed the title feature/sticker-positioning feature: Sticker Positioning Oct 29, 2023
@tyleryy
Copy link
Contributor

tyleryy commented Oct 29, 2023

I agree with @taesungh. At least for me, I get the big picture of creating a general use sticker wrapper component around some "anchor", but I am a bit lost on the details of this Sticker API.

@alexanderl19
Copy link
Contributor Author

alexanderl19 commented Oct 29, 2023

I've added some details documenting the API of the component. The wrapper component uses a flexbox to position the stickers.

@alexanderl19 alexanderl19 merged commit ff15acf into main Oct 29, 2023
2 checks passed
@alexanderl19 alexanderl19 deleted the feature/sticker-positioning branch October 29, 2023 21:41
@samderanova samderanova restored the feature/sticker-positioning branch October 30, 2023 18:22
@taesungh taesungh deleted the feature/sticker-positioning branch September 27, 2024 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants