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 #446

Merged
merged 1 commit into from
Feb 26, 2024
Merged

fixes #446

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
4 changes: 2 additions & 2 deletions app/components/Article/Contents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ const insertGlossary = (pageid: string, glossary: Glossary) => {
addPopup(
e as HTMLSpanElement,
`glossary-${entry.term}`,
`<div class="glossary-popup flex-container black col-6 small">
`<div class="glossary-popup flex-container black small">
<div class="contents col-8">
<h3>${entry.term}</h3>
<div class="small-bold">${entry.term}</div>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@melissasamworth you had p on the bug report, but that has auto padding set from the underlying article, so I left divs

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fine. In the future perhaps we can create a padding: 0 class to add or something

<div class="defintion">${entry.contents}</div>
${link || ''}
</div>
Expand Down
4 changes: 3 additions & 1 deletion app/components/Article/article.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ article .glossary-entry {
article .link-popup {
visibility: hidden;
opacity: 0;
width: 522px;
height: 304px;
position: absolute;
display: inline-block;
font: var(--baseFont);
Expand All @@ -83,7 +85,6 @@ article .contents a.button {
font-weight: normal;
}
article .link-popup .glossary-popup > .contents {
height: 21.46vw;
padding: var(--spacing-24) var(--spacing-40) var(--spacing-24);
}
article .defintion {
Expand All @@ -96,6 +97,7 @@ article .defintion {
}
article .link-popup .glossary-popup > img {
width: 100%;
height: 303px;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the image was covering the bottom border, so I chopped off a pixel here

border-top-right-radius: var(--border-radius);
border-bottom-right-radius: var(--border-radius);
}
Expand Down
8 changes: 4 additions & 4 deletions app/components/Widget/Stampy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const WidgetStampy = () => {
'Do people seriously worry about existential risk from AI?',
]

const stampyUrl = `https://chat.aisafety.info/?question=${question.trim()}`
const stampyUrl = (question: string) => `https://chat.aisafety.info/?question=${question.trim()}`
return (
<div className="chat col-10">
<div className="col-6 padding-bottom-56">
Expand All @@ -27,7 +27,7 @@ export const WidgetStampy = () => {
<div className="padding-bottom-24">Try asking me...</div>
{questions.map((question, i) => (
<div key={i} className="padding-bottom-16">
<Button className="secondary-alt" action={stampyUrl}>
<Button className="secondary-alt" action={stampyUrl(question)}>
{question}
</Button>
</div>
Expand All @@ -44,11 +44,11 @@ export const WidgetStampy = () => {
onChange={(e) => setQuestion(e.target.value)}
onKeyDown={(e) => {
if (e.key === 'Enter' && question.trim()) {
window.location = stampyUrl as any
window.location = stampyUrl(question) as any
}
}}
/>
<Link to={stampyUrl}>
<Link to={stampyUrl(question)}>
<SendIcon />
</Link>
</div>
Expand Down
Loading