mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
Vertically center elements in TodoFooters
This commit is contained in:
@@ -11,7 +11,7 @@ export const TodoFooter = (props: TodoFooterProps) => {
|
|||||||
const itemCount = Object.keys(props.todos).filter(id => !props.todos[id].completed).length;
|
const itemCount = Object.keys(props.todos).filter(id => !props.todos[id].completed).length;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack horizontal horizontalAlign="space-between">
|
<Stack horizontal horizontalAlign="space-between" verticalAlign="center">
|
||||||
<Text>
|
<Text>
|
||||||
{itemCount} item{itemCount === 1 ? '' : 's'} left
|
{itemCount} item{itemCount === 1 ? '' : 's'} left
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export const TodoFooter = (props: TodoFooterProps) => {
|
|||||||
// - try it with an object: styles={{ ... }}
|
// - try it with an object: styles={{ ... }}
|
||||||
// - try it with a function: styles={props => ({ ... })}
|
// - try it with a function: styles={props => ({ ... })}
|
||||||
return (
|
return (
|
||||||
<Stack horizontal horizontalAlign="space-between">
|
<Stack horizontal horizontalAlign="space-between" verticalAlign="center">
|
||||||
<Text>
|
<Text>
|
||||||
{itemCount} item{itemCount === 1 ? '' : 's'} left
|
{itemCount} item{itemCount === 1 ? '' : 's'} left
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export const TodoFooter = () => {
|
|||||||
const itemCount = Object.keys(context.todos).filter(id => !context.todos[id].completed).length;
|
const itemCount = Object.keys(context.todos).filter(id => !context.todos[id].completed).length;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack horizontal horizontalAlign="space-between">
|
<Stack horizontal horizontalAlign="space-between" verticalAlign="center">
|
||||||
<Text>
|
<Text>
|
||||||
{itemCount} item{itemCount === 1 ? '' : 's'} left
|
{itemCount} item{itemCount === 1 ? '' : 's'} left
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export const TodoFooter = () => {
|
|||||||
const itemCount = Object.keys(todos).filter(id => !todos[id].completed).length;
|
const itemCount = Object.keys(todos).filter(id => !todos[id].completed).length;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack horizontal horizontalAlign="space-between">
|
<Stack horizontal horizontalAlign="space-between" verticalAlign="center">
|
||||||
<Text>
|
<Text>
|
||||||
{itemCount} item{itemCount === 1 ? '' : 's'} left
|
{itemCount} item{itemCount === 1 ? '' : 's'} left
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const TodoFooter = (props: TodoFooterProps) => {
|
|||||||
const itemCount = Object.keys(todos).filter(id => !todos[id].completed).length;
|
const itemCount = Object.keys(todos).filter(id => !todos[id].completed).length;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack horizontal horizontalAlign="space-between">
|
<Stack horizontal horizontalAlign="space-between" verticalAlign="center">
|
||||||
<Text>
|
<Text>
|
||||||
{itemCount} item{itemCount === 1 ? '' : 's'} left
|
{itemCount} item{itemCount === 1 ? '' : 's'} left
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const TodoFooter = (props: TodoFooterProps) => {
|
|||||||
const itemCount = Object.keys(todos).filter(id => !todos[id].completed).length;
|
const itemCount = Object.keys(todos).filter(id => !todos[id].completed).length;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack horizontal horizontalAlign="space-between">
|
<Stack horizontal horizontalAlign="space-between" verticalAlign="center">
|
||||||
<Text>
|
<Text>
|
||||||
{itemCount} item{itemCount === 1 ? '' : 's'} left
|
{itemCount} item{itemCount === 1 ? '' : 's'} left
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
Reference in New Issue
Block a user